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