Class: Iloxx::Shipping::NormalpaketService

Inherits:
Service
  • Object
show all
Defined in:
lib/iloxx_shipping/service/normalpaket.rb

Instance Attribute Summary collapse

Attributes inherited from Service

#cod_amount

Instance Method Summary collapse

Methods inherited from Service

#cod?, #initialize

Constructor Details

This class inherits a constructor from Iloxx::Shipping::Service

Instance Attribute Details

#flexObject

Returns the value of attribute flex.



5
6
7
# File 'lib/iloxx_shipping/service/normalpaket.rb', line 5

def flex
  @flex
end

Instance Method Details

#cod=(cod) ⇒ Object



7
8
9
10
# File 'lib/iloxx_shipping/service/normalpaket.rb', line 7

def cod=(cod)
  raise "COD and Flex cannot be combined" if flex?
  @cod_amount = cod
end

#flex?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/iloxx_shipping/service/normalpaket.rb', line 17

def flex?
  !!@flex
end

#service_typeObject



21
22
23
# File 'lib/iloxx_shipping/service/normalpaket.rb', line 21

def service_type
  "dpdNormalpaket" + (cod? ? 'COD' : '') + (flex? ? 'Flex' : '')
end