Class: Whisperer::Generator
- Inherits:
-
Object
- Object
- Whisperer::Generator
- Extended by:
- Helpers
- Defined in:
- lib/whisperer/generator.rb
Instance Attribute Summary collapse
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(record, name) ⇒ Generator
constructor
A new instance of Generator.
Methods included from Helpers
Constructor Details
#initialize(record, name) ⇒ Generator
Returns a new instance of Generator.
9 10 11 |
# File 'lib/whisperer/generator.rb', line 9 def initialize(record, name) @record, @name = record, name end |
Instance Attribute Details
#record ⇒ Object (readonly)
Returns the value of attribute record.
7 8 9 |
# File 'lib/whisperer/generator.rb', line 7 def record @record end |
Instance Method Details
#generate ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/whisperer/generator.rb', line 13 def generate Preprocessors.process!(record) interaction = Convertors::Interaction.convert(record) self.uniq_cassette! cassette = VCR::Cassette.new("#{record.sub_path}/#{@name}") cassette.record_http_interaction( interaction ) cassette.eject File.read(path_to_cassette) end |