Class: Physical::Item
Overview
Represents a physical item which can be packed into a box.
Constant Summary collapse
- DEFAULT_LENGTH =
The default dimensions of this item when unspecified
0
Instance Attribute Summary collapse
-
#cost ⇒ Money
readonly
The cost for this item.
-
#description ⇒ String
readonly
A description for this item.
-
#sku ⇒ String
readonly
The SKU for this item.
Attributes inherited from Cuboid
#dimensions, #height, #id, #length, #properties, #weight, #width
Instance Method Summary collapse
-
#initialize(**kwargs) ⇒ Item
constructor
A new instance of Item.
Methods inherited from Cuboid
Constructor Details
#initialize(**kwargs) ⇒ Item
Returns a new instance of Item.
29 30 31 32 33 34 |
# File 'lib/physical/item.rb', line 29 def initialize(**kwargs) @cost = Types::Money.optional[kwargs.delete(:cost)] @sku = kwargs.delete(:sku) @description = kwargs.delete(:description) super(**kwargs) end |
Instance Attribute Details
#cost ⇒ Money (readonly)
The cost for this item
11 12 13 |
# File 'lib/physical/item.rb', line 11 def cost @cost end |
#description ⇒ String (readonly)
A description for this item
19 20 21 |
# File 'lib/physical/item.rb', line 19 def description @description end |
#sku ⇒ String (readonly)
The SKU for this item
15 16 17 |
# File 'lib/physical/item.rb', line 15 def sku @sku end |