Add delegate methods to shipment class
This commit is contained in:
parent
e0d300c441
commit
47a013eb66
@ -10,6 +10,22 @@ module PlanetExpress
|
||||
@discounts = []
|
||||
end
|
||||
|
||||
def month
|
||||
date.begin_of_month
|
||||
end
|
||||
|
||||
def s_shipment?
|
||||
shipping_option.s_shipment?
|
||||
end
|
||||
|
||||
def l_shipment?
|
||||
shipping_option.l_shipment?
|
||||
end
|
||||
|
||||
def provider
|
||||
shipping_option.provider
|
||||
end
|
||||
|
||||
def if_valid(&block)
|
||||
yield self
|
||||
end
|
||||
@ -19,7 +35,7 @@ module PlanetExpress
|
||||
end
|
||||
|
||||
def inspect
|
||||
"#{self.class.name} [#{date} #{shipping_option}]"
|
||||
"#{self.class.name} [#{date} #{shipping_option.inspect} #{discounts}]"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user