Class: RR::DoubleDefinitions::DoubleDefinitionCreateBlankSlate
- Inherits:
-
Object
- Object
- RR::DoubleDefinitions::DoubleDefinitionCreateBlankSlate
- Defined in:
- lib/rr/double_definitions/double_definition_create_blank_slate.rb
Instance Method Summary collapse
- #__double_definition_create__ ⇒ Object
-
#initialize(double_definition_create, &block) ⇒ DoubleDefinitionCreateBlankSlate
constructor
:nodoc:.
- #method_missing(method_name, *args, &block) ⇒ Object
Constructor Details
#initialize(double_definition_create, &block) ⇒ DoubleDefinitionCreateBlankSlate
:nodoc:
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/rr/double_definitions/double_definition_create_blank_slate.rb', line 4 def initialize(double_definition_create, &block) #:nodoc: @double_definition_create = double_definition_create BlankSlate.call(respond_to?(:class) ? self.class : __blank_slated_class) if block_given? if block.arity == 1 yield(self) else respond_to?(:instance_eval) ? instance_eval(&block) : __blank_slated_instance_eval(&block) end end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
18 19 20 |
# File 'lib/rr/double_definitions/double_definition_create_blank_slate.rb', line 18 def method_missing(method_name, *args, **kwargs, &block) @double_definition_create.call(method_name, args, kwargs, &block) end |
Instance Method Details
#__double_definition_create__ ⇒ Object
28 29 30 |
# File 'lib/rr/double_definitions/double_definition_create_blank_slate.rb', line 28 def __double_definition_create__ @double_definition_create end |