Class: Epages::VariationAttribute

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/epages/variation_attribute.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nameObject

Returns the value of attribute display_name.



7
8
9
# File 'lib/epages/variation_attribute.rb', line 7

def display_name
  @display_name
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/epages/variation_attribute.rb', line 7

def name
  @name
end

#valuesObject

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_valuesObject

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_valuesObject

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