Class: Dpd::Shipping::NormalpaketService

Inherits:
Service
  • Object
show all
Defined in:
lib/dpd_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 Dpd::Shipping::Service

Instance Attribute Details

#flexObject

Returns the value of attribute flex.



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

def flex
  @flex
end

Instance Method Details

#cod=(cod) ⇒ Object



7
8
9
10
# File 'lib/dpd_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/dpd_shipping/service/normalpaket.rb', line 17

def flex?
  !!@flex
end

#service_typeObject



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

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