Class: FlexCommerce::PaypalExpress::CartShippingMethod
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- FlexCommerce::PaypalExpress::CartShippingMethod
- Defined in:
- lib/paypal_express/cart_shipping_method.rb
Overview
Used to decorate shipping methods based on Promotions
Constant Summary collapse
- ZERO =
BigDecimal(0)
Instance Method Summary collapse
-
#initialize(shipping_method, free) ⇒ CartShippingMethod
constructor
A new instance of CartShippingMethod.
- #is_free? ⇒ Boolean
- #tax ⇒ Object
- #total ⇒ Object
Constructor Details
#initialize(shipping_method, free) ⇒ CartShippingMethod
Returns a new instance of CartShippingMethod.
12 13 14 15 |
# File 'lib/paypal_express/cart_shipping_method.rb', line 12 def initialize(shipping_method, free) super(shipping_method) self.free = free end |
Instance Method Details
#is_free? ⇒ Boolean
17 18 19 |
# File 'lib/paypal_express/cart_shipping_method.rb', line 17 def is_free? free end |
#tax ⇒ Object
26 27 28 29 |
# File 'lib/paypal_express/cart_shipping_method.rb', line 26 def tax return ZERO if is_free? super end |
#total ⇒ Object
21 22 23 24 |
# File 'lib/paypal_express/cart_shipping_method.rb', line 21 def total return ZERO if is_free? super end |