Class: SimpleShipping::Package
- Inherits:
-
Abstract::Model
- Object
- Abstract::Model
- SimpleShipping::Package
- Defined in:
- lib/simple_shipping/package.rb
Overview
Represents a package which should be sent from shipper to recipient.
Attributes:
-
dimenstion_units (:in, :cm). Default is :in.
-
weight_units (:kg, :lb). Default is :lb.
-
legth (in dimension units)
-
width (in dimension units)
-
height (in dimension units)
-
weight (in weight units)
-
packaging_type
Packaging type values:
-
:envelope
-
:your
-
:tube
-
:pak
-
:box
-
:box_10kg
-
:box_25kg
Instance Attribute Summary collapse
-
#declared_value ⇒ Object
Returns the value of attribute declared_value.
-
#dimension_units ⇒ Object
Returns the value of attribute dimension_units.
-
#height ⇒ Object
Returns the value of attribute height.
-
#insured_value ⇒ Object
Returns the value of attribute insured_value.
-
#length ⇒ Object
Returns the value of attribute length.
-
#packaging_type ⇒ Object
Returns the value of attribute packaging_type.
-
#weight ⇒ Object
Returns the value of attribute weight.
-
#weight_units ⇒ Object
Returns the value of attribute weight_units.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
-
#custom_package? ⇒ Boolean
Whether the package is a custom package.
Methods inherited from Abstract::Model
#initialize, set_default_values, validates_submodel
Constructor Details
This class inherits a constructor from SimpleShipping::Abstract::Model
Instance Attribute Details
#declared_value ⇒ Object
Returns the value of attribute declared_value.
25 26 27 |
# File 'lib/simple_shipping/package.rb', line 25 def declared_value @declared_value end |
#dimension_units ⇒ Object
Returns the value of attribute dimension_units.
23 24 25 |
# File 'lib/simple_shipping/package.rb', line 23 def dimension_units @dimension_units end |
#height ⇒ Object
Returns the value of attribute height.
23 24 25 |
# File 'lib/simple_shipping/package.rb', line 23 def height @height end |
#insured_value ⇒ Object
Returns the value of attribute insured_value.
25 26 27 |
# File 'lib/simple_shipping/package.rb', line 25 def insured_value @insured_value end |
#length ⇒ Object
Returns the value of attribute length.
23 24 25 |
# File 'lib/simple_shipping/package.rb', line 23 def length @length end |
#packaging_type ⇒ Object
Returns the value of attribute packaging_type.
24 25 26 |
# File 'lib/simple_shipping/package.rb', line 24 def packaging_type @packaging_type end |
#weight ⇒ Object
Returns the value of attribute weight.
24 25 26 |
# File 'lib/simple_shipping/package.rb', line 24 def weight @weight end |
#weight_units ⇒ Object
Returns the value of attribute weight_units.
24 25 26 |
# File 'lib/simple_shipping/package.rb', line 24 def weight_units @weight_units end |
#width ⇒ Object
Returns the value of attribute width.
23 24 25 |
# File 'lib/simple_shipping/package.rb', line 23 def width @width end |
Instance Method Details
#custom_package? ⇒ Boolean
Whether the package is a custom package.
39 40 41 |
# File 'lib/simple_shipping/package.rb', line 39 def custom_package? packaging_type == :your end |