Class: Brujula::ObjectBuilder
- Inherits:
-
Object
- Object
- Brujula::ObjectBuilder
- Defined in:
- lib/brujula/object_builder.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#key_data ⇒ Object
readonly
Returns the value of attribute key_data.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(definition:, data:, key:) ⇒ ObjectBuilder
constructor
A new instance of ObjectBuilder.
Constructor Details
#initialize(definition:, data:, key:) ⇒ ObjectBuilder
Returns a new instance of ObjectBuilder.
5 6 7 8 9 10 |
# File 'lib/brujula/object_builder.rb', line 5 def initialize(definition:, data:, key:) @definition = definition @data = data @key = key @key_data = extract_and_transform_data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/brujula/object_builder.rb', line 3 def data @data end |
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
3 4 5 |
# File 'lib/brujula/object_builder.rb', line 3 def definition @definition end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
3 4 5 |
# File 'lib/brujula/object_builder.rb', line 3 def key @key end |
#key_data ⇒ Object (readonly)
Returns the value of attribute key_data.
3 4 5 |
# File 'lib/brujula/object_builder.rb', line 3 def key_data @key_data end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/brujula/object_builder.rb', line 12 def call return nil if key_data.nil? return object_reference if is_object_reference? return map_object_reference if is_map_object_reference? object_class.new(new_object_arguments). end |