Module: BuildingBlocks::Builders::BuilderBuilder::InstanceMethods
- Defined in:
- lib/building_blocks/builders/builder_builder.rb
Overview
Methods available to instances of a generated builder class.
Instance Method Summary collapse
-
#example_builder_attr(existing_object = nil, &block) ⇒ Object
Reference for instance methods defined via ClassInstanceMethods#builder.
-
#initialize(instance) ⇒ Object
Initializes a new instance of the generated builder class.
-
#instance ⇒ Object
Returns the object instance being built by the builder instance.
Instance Method Details
#example_builder_attr(existing_object = nil, &block) ⇒ Object
Reference for instance methods defined via ClassInstanceMethods#builder.
This method is not actually defined, but serves as a reference for the instance method defined when an attribute is defined on the parent builder class using ClassInstanceMethods#builder.
Invokes the receiver_method of receiver with the provided
existing_object or a new object generated by invoking the
build method of the derived builder_class with the given
block.
|
|
# File 'lib/building_blocks/builders/builder_builder.rb', line 313
|
#initialize(instance) ⇒ Object
Initializes a new instance of the generated builder class. Requires the resource class instance that the builder will populate to be provided.
301 302 303 |
# File 'lib/building_blocks/builders/builder_builder.rb', line 301 def initialize(instance) @instance = instance end |
#instance ⇒ Object
Returns the object instance being built by the builder instance.
309 310 311 |
# File 'lib/building_blocks/builders/builder_builder.rb', line 309 def instance return @instance end |