Class: FakerMaker::DefinitionProxy
- Inherits:
-
Object
- Object
- FakerMaker::DefinitionProxy
- Includes:
- LifecycleHooks::DefinitionProxy
- Defined in:
- lib/faker_maker/definition_proxy.rb
Overview
Proxy for mapping attribute names
Instance Method Summary collapse
- #faker_maker_factory ⇒ Object
-
#initialize(factory) ⇒ DefinitionProxy
constructor
A new instance of DefinitionProxy.
- #method_missing(name, *args, &block) ⇒ Object
- #respond_to_missing?(method_name, include_private = false) ⇒ Boolean
Methods included from LifecycleHooks::DefinitionProxy
Constructor Details
#initialize(factory) ⇒ DefinitionProxy
Returns a new instance of DefinitionProxy.
8 9 10 |
# File 'lib/faker_maker/definition_proxy.rb', line 8 def initialize(factory) @factory = factory end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
16 17 18 19 |
# File 'lib/faker_maker/definition_proxy.rb', line 16 def method_missing(name, *args, &block) attribute = FakerMaker::Attribute.new name, block, *args @factory.attach_attribute attribute end |
Instance Method Details
#faker_maker_factory ⇒ Object
12 13 14 |
# File 'lib/faker_maker/definition_proxy.rb', line 12 def faker_maker_factory @factory end |
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
21 22 23 |
# File 'lib/faker_maker/definition_proxy.rb', line 21 def respond_to_missing?(method_name, include_private = false) super end |