Class: FriendlyShipping::ShippingMethod
- Inherits:
-
Object
- Object
- FriendlyShipping::ShippingMethod
- Defined in:
- lib/friendly_shipping/shipping_method.rb
Instance Attribute Summary collapse
-
#carrier ⇒ Object
readonly
Returns the value of attribute carrier.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#origin_countries ⇒ Object
readonly
Returns the value of attribute origin_countries.
-
#service_code ⇒ Object
readonly
Returns the value of attribute service_code.
Instance Method Summary collapse
- #domestic? ⇒ Boolean
-
#initialize(name: nil, service_code: nil, domestic: nil, international: nil, multi_package: nil, carrier: nil, origin_countries: [], data: {}) ⇒ ShippingMethod
constructor
A new instance of ShippingMethod.
- #international? ⇒ Boolean
- #multi_package? ⇒ Boolean
Constructor Details
#initialize(name: nil, service_code: nil, domestic: nil, international: nil, multi_package: nil, carrier: nil, origin_countries: [], data: {}) ⇒ ShippingMethod
Returns a new instance of ShippingMethod.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/friendly_shipping/shipping_method.rb', line 15 def initialize( name: nil, service_code: nil, domestic: nil, international: nil, multi_package: nil, carrier: nil, origin_countries: [], data: {} ) @name = name @service_code = service_code @domestic = domestic @international = international @multi_package = multi_package @carrier = carrier @origin_countries = origin_countries @data = data end |
Instance Attribute Details
#carrier ⇒ Object (readonly)
Returns the value of attribute carrier.
5 6 7 |
# File 'lib/friendly_shipping/shipping_method.rb', line 5 def carrier @carrier end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/friendly_shipping/shipping_method.rb', line 5 def data @data end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/friendly_shipping/shipping_method.rb', line 5 def name @name end |
#origin_countries ⇒ Object (readonly)
Returns the value of attribute origin_countries.
5 6 7 |
# File 'lib/friendly_shipping/shipping_method.rb', line 5 def origin_countries @origin_countries end |
#service_code ⇒ Object (readonly)
Returns the value of attribute service_code.
5 6 7 |
# File 'lib/friendly_shipping/shipping_method.rb', line 5 def service_code @service_code end |
Instance Method Details
#domestic? ⇒ Boolean
35 36 37 |
# File 'lib/friendly_shipping/shipping_method.rb', line 35 def domestic? !!domestic end |
#international? ⇒ Boolean
39 40 41 |
# File 'lib/friendly_shipping/shipping_method.rb', line 39 def international? !!international end |
#multi_package? ⇒ Boolean
43 44 45 |
# File 'lib/friendly_shipping/shipping_method.rb', line 43 def multi_package? !!multi_package end |