Class: Tailmix::Definition::Result::Element
- Inherits:
-
Struct
- Object
- Struct
- Tailmix::Definition::Result::Element
- Defined in:
- lib/tailmix/definition/result.rb
Instance Attribute Summary collapse
-
#attribute_bindings ⇒ Object
Returns the value of attribute attribute_bindings.
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#compound_variants ⇒ Object
Returns the value of attribute compound_variants.
-
#default_attributes ⇒ Object
Returns the value of attribute default_attributes.
-
#dimensions ⇒ Object
Returns the value of attribute dimensions.
-
#event_bindings ⇒ Object
Returns the value of attribute event_bindings.
-
#model_bindings ⇒ Object
Returns the value of attribute model_bindings.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#attribute_bindings ⇒ Object
Returns the value of attribute attribute_bindings
19 20 21 |
# File 'lib/tailmix/definition/result.rb', line 19 def attribute_bindings @attribute_bindings end |
#attributes ⇒ Object
Returns the value of attribute attributes
19 20 21 |
# File 'lib/tailmix/definition/result.rb', line 19 def attributes @attributes end |
#compound_variants ⇒ Object
Returns the value of attribute compound_variants
19 20 21 |
# File 'lib/tailmix/definition/result.rb', line 19 def compound_variants @compound_variants end |
#default_attributes ⇒ Object
Returns the value of attribute default_attributes
19 20 21 |
# File 'lib/tailmix/definition/result.rb', line 19 def default_attributes @default_attributes end |
#dimensions ⇒ Object
Returns the value of attribute dimensions
19 20 21 |
# File 'lib/tailmix/definition/result.rb', line 19 def dimensions @dimensions end |
#event_bindings ⇒ Object
Returns the value of attribute event_bindings
19 20 21 |
# File 'lib/tailmix/definition/result.rb', line 19 def event_bindings @event_bindings end |
#model_bindings ⇒ Object
Returns the value of attribute model_bindings
19 20 21 |
# File 'lib/tailmix/definition/result.rb', line 19 def model_bindings @model_bindings end |
#name ⇒ Object
Returns the value of attribute name
19 20 21 |
# File 'lib/tailmix/definition/result.rb', line 19 def name @name end |
Instance Method Details
#to_h ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/tailmix/definition/result.rb', line 20 def to_h { name: name, attributes: attributes.to_h, default_attributes: default_attributes, dimensions: dimensions.transform_values do |dimension| dimension.transform_values do |value| case value when Variant value.to_h when Hash value.transform_values { |v| v.respond_to?(:to_h) ? v.to_h : v } else value end end end, compound_variants: compound_variants, attribute_bindings: attribute_bindings, model_bindings: model_bindings, } end |