Class: Workarea::Shipping::Sku
Instance Attribute Summary collapse
Instance Method Summary
collapse
#releasable?
add_worker, assert_valid_config!, async, caching_classes?, disable, enable, inline, #run_callbacks, workers, workers_list
#embedded_children
Instance Attribute Details
#dimensions ⇒ Array
Returns Height x Width x Length.
12
|
# File 'app/models/workarea/shipping/sku.rb', line 12
field :dimensions, type: Array, default: []
|
Instance Method Details
#height ⇒ Object
14
15
16
|
# File 'app/models/workarea/shipping/sku.rb', line 14
def height
dimensions.first
end
|
#length ⇒ Object
22
23
24
|
# File 'app/models/workarea/shipping/sku.rb', line 22
def length
dimensions.third
end
|
#length_units ⇒ Object
26
27
28
|
# File 'app/models/workarea/shipping/sku.rb', line 26
def length_units
Workarea.config.shipping_options[:units] == :imperial ? :inches : :centimeters
end
|
#weight_units ⇒ Object
30
31
32
|
# File 'app/models/workarea/shipping/sku.rb', line 30
def weight_units
Workarea.config.shipping_options[:units] == :imperial ? :ounces : :grams
end
|
#width ⇒ Object
18
19
20
|
# File 'app/models/workarea/shipping/sku.rb', line 18
def width
dimensions.second
end
|