Class: Epages::VariationAttribute
- Inherits:
-
Object
- Object
- Epages::VariationAttribute
- Includes:
- Utils
- Defined in:
- lib/epages/variation_attribute.rb
Instance Attribute Summary collapse
-
#display_name ⇒ Object
Returns the value of attribute display_name.
-
#name ⇒ Object
Returns the value of attribute name.
-
#values ⇒ Object
Returns the value of attribute values.
Instance Method Summary collapse
-
#display_values ⇒ Object
returns an array with all the display_values.
-
#formatted_values ⇒ Object
returns an array with all the values.
-
#initialize(data) ⇒ VariationAttribute
constructor
A new instance of VariationAttribute.
Methods included from Utils
build_shop_from, camelize_keys, camelize_words, options_to_multipart_request, options_to_patch_request, parse_attribute_as, parse_attribute_as_array_of, parse_attributes, symbolize_keys!, to_query_options, underscorize_keys
Constructor Details
#initialize(data) ⇒ VariationAttribute
Returns a new instance of VariationAttribute.
9 10 11 |
# File 'lib/epages/variation_attribute.rb', line 9 def initialize(data) parse_attributes(data) end |
Instance Attribute Details
#display_name ⇒ Object
Returns the value of attribute display_name.
7 8 9 |
# File 'lib/epages/variation_attribute.rb', line 7 def display_name @display_name end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/epages/variation_attribute.rb', line 7 def name @name end |
#values ⇒ Object
Returns the value of attribute values.
7 8 9 |
# File 'lib/epages/variation_attribute.rb', line 7 def values @values end |
Instance Method Details
#display_values ⇒ Object
returns an array with all the display_values
19 20 21 |
# File 'lib/epages/variation_attribute.rb', line 19 def display_values values.collect { |el| el[:displayValue] } end |
#formatted_values ⇒ Object
returns an array with all the values
14 15 16 |
# File 'lib/epages/variation_attribute.rb', line 14 def formatted_values values.collect { |el| el[:value] } end |