Class: Redstruct::Factory::Object
- Inherits:
-
Object
- Object
- Redstruct::Factory::Object
- Includes:
- Utils::Inspectable
- Defined in:
- lib/redstruct/factory/object.rb
Overview
Base class for all objects a factory can produce
Direct Known Subclasses
Instance Attribute Summary collapse
-
#factory ⇒ Redstruct::Factory
readonly
Factory which was used to create the object.
Instance Method Summary collapse
-
#connection ⇒ Redstruct::ConnectionProxy
Convenience accessor for the factory’s connection.
-
#initialize(factory:) ⇒ Object
constructor
A new instance of Object.
-
#inspectable_attributes ⇒ Object
# @!visibility private.
Methods included from Utils::Inspectable
Constructor Details
#initialize(factory:) ⇒ Object
Returns a new instance of Object.
15 16 17 |
# File 'lib/redstruct/factory/object.rb', line 15 def initialize(factory:) @factory = factory end |
Instance Attribute Details
#factory ⇒ Redstruct::Factory (readonly)
Returns factory which was used to create the object.
12 13 14 |
# File 'lib/redstruct/factory/object.rb', line 12 def factory @factory end |
Instance Method Details
#connection ⇒ Redstruct::ConnectionProxy
Convenience accessor for the factory’s connection
21 22 23 |
# File 'lib/redstruct/factory/object.rb', line 21 def connection return @factory.connection end |
#inspectable_attributes ⇒ Object
# @!visibility private
26 27 28 |
# File 'lib/redstruct/factory/object.rb', line 26 def inspectable_attributes { factory: @factory } end |