Module: SPV::Mixins::Page::ClassMethods
- Defined in:
- lib/site_prism_vcr/mixins/page.rb
Instance Attribute Summary collapse
-
#vcr_adjuster ⇒ Object
readonly
Returns the value of attribute vcr_adjuster.
-
#vcr_child_adjusters ⇒ Object
readonly
Returns the value of attribute vcr_child_adjusters.
Instance Method Summary collapse
- #adjust_parent_vcr_options(&block) ⇒ Object
- #inherited(subclass) ⇒ Object
- #vcr_options_for_load(&block) ⇒ Object
Instance Attribute Details
#vcr_adjuster ⇒ Object (readonly)
Returns the value of attribute vcr_adjuster.
13 14 15 |
# File 'lib/site_prism_vcr/mixins/page.rb', line 13 def vcr_adjuster @vcr_adjuster end |
#vcr_child_adjusters ⇒ Object (readonly)
Returns the value of attribute vcr_child_adjusters.
13 14 15 |
# File 'lib/site_prism_vcr/mixins/page.rb', line 13 def vcr_child_adjusters @vcr_child_adjusters end |
Instance Method Details
#adjust_parent_vcr_options(&block) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/site_prism_vcr/mixins/page.rb', line 27 def (&block) raise ArgumentError.new( 'There is not any Vcr options defined for the parent class' ) unless self.vcr_adjuster self.vcr_child_adjusters << block end |
#inherited(subclass) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/site_prism_vcr/mixins/page.rb', line 15 def inherited(subclass) # This code is required to allow subpages to inherit # a defined adjuster block. Otherwise, that block should be # duplicated in a subpage as well. subclass.instance_variable_set(:@vcr_adjuster, @vcr_adjuster) subclass.instance_variable_set(:@vcr_child_adjusters, @vcr_child_adjusters.dup) end |
#vcr_options_for_load(&block) ⇒ Object
23 24 25 |
# File 'lib/site_prism_vcr/mixins/page.rb', line 23 def (&block) @vcr_adjuster = block end |