Class: Workarea::GlobalE::Attribute
- Inherits:
-
Object
- Object
- Workarea::GlobalE::Attribute
- Defined in:
- app/services/workarea/global_e/attribute.rb
Instance Method Summary collapse
- #as_json(*_args) ⇒ Object
-
#attribute_code ⇒ String
Custom attribute code denoting a Merchant-specific attribute such as Size, Color, etc.
-
#attribute_type_code ⇒ Object
Code used to identify the attribute type on the Merchant’s site such as “size” for Size, “color” for Color, etc.
-
#initialize(code: nil, name: nil, type_code: nil) ⇒ Attribute
constructor
A new instance of Attribute.
-
#name ⇒ String
Attribute name.
Constructor Details
#initialize(code: nil, name: nil, type_code: nil) ⇒ Attribute
Returns a new instance of Attribute.
5 6 7 8 9 |
# File 'app/services/workarea/global_e/attribute.rb', line 5 def initialize(code: nil, name: nil, type_code: nil) @code = code @name = name @type_code = type_code end |
Instance Method Details
#as_json(*_args) ⇒ Object
11 12 13 14 15 16 17 |
# File 'app/services/workarea/global_e/attribute.rb', line 11 def as_json(*_args) { AttributeCode: attribute_code, Name: name, AttributeTypeCode: attribute_type_code }.compact end |
#attribute_code ⇒ String
Custom attribute code denoting a Merchant-specific attribute such as Size, Color, etc. (to be mapped on Global-e side)
24 25 26 |
# File 'app/services/workarea/global_e/attribute.rb', line 24 def attribute_code @code end |
#attribute_type_code ⇒ Object
Code used to identify the attribute type on the Merchant’s site such as “size” for Size, “color” for Color, etc. (to be mapped on Global-e side)
39 40 41 |
# File 'app/services/workarea/global_e/attribute.rb', line 39 def attribute_type_code @type_code end |
#name ⇒ String
Attribute name
32 33 34 |
# File 'app/services/workarea/global_e/attribute.rb', line 32 def name @name end |