Class: SimpleShipping::Package

Inherits:
Abstract::Model show all
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

Instance Method Summary collapse

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_valueObject

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_unitsObject

Returns the value of attribute dimension_units.



23
24
25
# File 'lib/simple_shipping/package.rb', line 23

def dimension_units
  @dimension_units
end

#heightObject

Returns the value of attribute height.



23
24
25
# File 'lib/simple_shipping/package.rb', line 23

def height
  @height
end

#insured_valueObject

Returns the value of attribute insured_value.



25
26
27
# File 'lib/simple_shipping/package.rb', line 25

def insured_value
  @insured_value
end

#lengthObject

Returns the value of attribute length.



23
24
25
# File 'lib/simple_shipping/package.rb', line 23

def length
  @length
end

#packaging_typeObject

Returns the value of attribute packaging_type.



24
25
26
# File 'lib/simple_shipping/package.rb', line 24

def packaging_type
  @packaging_type
end

#weightObject

Returns the value of attribute weight.



24
25
26
# File 'lib/simple_shipping/package.rb', line 24

def weight
  @weight
end

#weight_unitsObject

Returns the value of attribute weight_units.



24
25
26
# File 'lib/simple_shipping/package.rb', line 24

def weight_units
  @weight_units
end

#widthObject

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.

Returns:

  • (Boolean)


39
40
41
# File 'lib/simple_shipping/package.rb', line 39

def custom_package?
  packaging_type == :your
end