def define_cassette_placeholder(placeholder, tag = nil, &block)
      before_record(tag) do |interaction|
        orig_text = call_block(block, interaction)
        log "before_record: replacing #{orig_text.inspect} with #{placeholder.inspect}"
        interaction.filter!(orig_text, placeholder)
      end

      before_playback(tag) do |interaction|
        orig_text = call_block(block, interaction)
        log "before_playback: replacing #{orig_text.inspect} with #{placeholder.inspect}"
        interaction.filter!(placeholder, orig_text)
      end
    end
def define_cassette_placeholder(placeholder, tag = nil, &block)
      before_record(tag) do |interaction|
        orig_text = call_block(block, interaction)
        log "before_record: replacing #{orig_text.inspect} with #{placeholder.inspect}"
        interaction.filter!(orig_text, placeholder)
      end

      before_playback(tag) do |interaction|
        orig_text = call_block(block, interaction)
        log "before_playback: replacing #{orig_text.inspect} with #{placeholder.inspect}"
        interaction.filter!(placeholder, orig_text)
      end
    end
Sets up a {#before_record} and a {#before_playback} hook that will
 insert a placeholder string in the cassette in place of another string.
 You can use this as a generic way to interpolate a variable into the
 cassette for a unique string. It's particularly useful for unique
 sensitive strings like API keys and passwords.

 @example
   VCR.configure do |c|
     # Put "<GITHUB_API_KEY>" in place of the actual API key in
     # our cassettes so we don't have to commit to source control.
     c.filter_sensitive_data('<GITHUB_API_KEY>') { GithubClient.api_key }

     # Put a "<USER_ID>" placeholder variable in our cassettes tagged with
     # :user_cassette since it can be different for different test runs.
     c.define_cassette_placeholder('<USER_ID>', :user_cassette) { User.last.id }
   end

 @param placeholder [String] The placeholder string.
 @param tag [Symbol] Set this to apply this only to cassettes
  with a matching tag; otherwise it will apply to every cassette.
 @yield block that determines what string to replace
 @yieldparam interaction [(optional) VCR::HTTPInteraction::HookAware] the HTTP interaction
 @yieldreturn the string to replace