Class: SPV::Fixtures::Handler
- Inherits:
-
Object
- Object
- SPV::Fixtures::Handler
- Defined in:
- lib/site_prism_vcr/fixtures/handler.rb
Overview
Prepares incoming raw list of fixtures to be used for inserting into VCR.
Applies a given list of modifiers to list of fixtures.
Instance Method Summary collapse
- #handle_raw(raw_fixtures, modifiers) ⇒ Object
- #handle_set_raws(*fixtures_set, modifiers) ⇒ Object
-
#initialize(options, convertor = Converter) ⇒ Handler
constructor
A new instance of Handler.
Constructor Details
Instance Method Details
#handle_raw(raw_fixtures, modifiers) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/site_prism_vcr/fixtures/handler.rb', line 14 def handle_raw(raw_fixtures, modifiers) converted_fixtures = @converter.convert_raw(raw_fixtures) modifiers.map do |modifier| converted_fixtures.each do |converted_fixture| modifier.modify(converted_fixture) end end converted_fixtures end |
#handle_set_raws(*fixtures_set, modifiers) ⇒ Object
26 27 28 29 30 |
# File 'lib/site_prism_vcr/fixtures/handler.rb', line 26 def handle_set_raws(*fixtures_set, modifiers) fixtures_set.map do |fixtures_raw| handle_raw fixtures_raw, modifiers end end |