Class: SolidusShipwire::ShipwireObject
- Inherits:
-
Object
- Object
- SolidusShipwire::ShipwireObject
- Defined in:
- lib/solidus_shipwire/shipwire_object.rb
Instance Attribute Summary collapse
-
#attrs ⇒ Object
Returns the value of attribute attrs.
-
#id ⇒ Object
Returns the value of attribute id.
-
#object ⇒ Object
Returns the value of attribute object.
Instance Method Summary collapse
- #base_product? ⇒ Boolean
- #classification ⇒ Object
-
#initialize(id, object, attrs) ⇒ ShipwireObject
constructor
A new instance of ShipwireObject.
- #kit? ⇒ Boolean
- #marketing_insert? ⇒ Boolean
- #virtual_kit? ⇒ Boolean
Constructor Details
#initialize(id, object, attrs) ⇒ ShipwireObject
Returns a new instance of ShipwireObject.
4 5 6 7 8 |
# File 'lib/solidus_shipwire/shipwire_object.rb', line 4 def initialize(id, object, attrs) @id = id @object = object @attrs = attrs.with_indifferent_access end |
Instance Attribute Details
#attrs ⇒ Object
Returns the value of attribute attrs.
2 3 4 |
# File 'lib/solidus_shipwire/shipwire_object.rb', line 2 def attrs @attrs end |
#id ⇒ Object
Returns the value of attribute id.
2 3 4 |
# File 'lib/solidus_shipwire/shipwire_object.rb', line 2 def id @id end |
#object ⇒ Object
Returns the value of attribute object.
2 3 4 |
# File 'lib/solidus_shipwire/shipwire_object.rb', line 2 def object @object end |
Instance Method Details
#base_product? ⇒ Boolean
18 19 20 |
# File 'lib/solidus_shipwire/shipwire_object.rb', line 18 def base_product? classification == 'baseProduct' end |
#classification ⇒ Object
10 11 12 |
# File 'lib/solidus_shipwire/shipwire_object.rb', line 10 def classification @attrs[:classification] end |
#kit? ⇒ Boolean
26 27 28 |
# File 'lib/solidus_shipwire/shipwire_object.rb', line 26 def kit? classification == 'kit' end |
#marketing_insert? ⇒ Boolean
22 23 24 |
# File 'lib/solidus_shipwire/shipwire_object.rb', line 22 def marketing_insert? classification == 'marketingInsert' end |
#virtual_kit? ⇒ Boolean
14 15 16 |
# File 'lib/solidus_shipwire/shipwire_object.rb', line 14 def virtual_kit? classification == 'virtualKit' end |