Method: VCR::Cassette#initialize

Defined in:
lib/vcr/cassette.rb

#initialize(name, options = {}) ⇒ Cassette

Returns a new instance of Cassette.

Parameters:

  • name (#to_s)

    The name of the cassette. VCR will sanitize this to ensure it is a valid file name.

  • options (Hash) (defaults to: {})

    The cassette options. The given options will be merged with the configured default_cassette_options.

See Also:



58
59
60
61
62
63
64
65
66
67
68
# File 'lib/vcr/cassette.rb', line 58

def initialize(name, options = {})
  @name    = name
  @options = VCR.configuration.default_cassette_options.merge(options)
  @mutex   = Mutex.new

  assert_valid_options!
  extract_options
  raise_error_unless_valid_record_mode

  log "Initialized with options: #{@options.inspect}"
end