Class: Iloxx::Shipping::Service

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Service

Returns a new instance of Service.



6
7
8
9
10
11
12
13
# File 'lib/iloxx_shipping/service.rb', line 6

def initialize(attributes = {})
  attributes.each do |key, value|
    setter = :"#{key.to_s}="
    if self.respond_to?(setter)
      self.send(setter, value)
    end
  end
end

Instance Attribute Details

#cod_amountObject (readonly)

Returns the value of attribute cod_amount.



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

def cod_amount
  @cod_amount
end

#service_typeObject (readonly)

Returns the value of attribute service_type.



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

def service_type
  @service_type
end

Instance Method Details

#cod?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/iloxx_shipping/service.rb', line 15

def cod?
  !self.cod_amount.nil? && self.cod_amount > 0
end