Class: OnlinePayments::SDK::Domain::SurchargeRate

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/surcharge_rate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#ad_valorem_ratefloat

Returns the current value of ad_valorem_rate.

Returns:

  • (float)

    the current value of ad_valorem_rate



13
14
15
# File 'lib/onlinepayments/sdk/domain/surcharge_rate.rb', line 13

def ad_valorem_rate
  @ad_valorem_rate
end

#specific_rateInteger

Returns the current value of specific_rate.

Returns:

  • (Integer)

    the current value of specific_rate



13
14
15
# File 'lib/onlinepayments/sdk/domain/surcharge_rate.rb', line 13

def specific_rate
  @specific_rate
end

#surcharge_product_type_idString

Returns the current value of surcharge_product_type_id.

Returns:

  • (String)

    the current value of surcharge_product_type_id



13
14
15
# File 'lib/onlinepayments/sdk/domain/surcharge_rate.rb', line 13

def surcharge_product_type_id
  @surcharge_product_type_id
end

#surcharge_product_type_versionString

Returns the current value of surcharge_product_type_version.

Returns:

  • (String)

    the current value of surcharge_product_type_version



13
14
15
# File 'lib/onlinepayments/sdk/domain/surcharge_rate.rb', line 13

def surcharge_product_type_version
  @surcharge_product_type_version
end

Instance Method Details

#from_hash(hash) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/onlinepayments/sdk/domain/surcharge_rate.rb', line 33

def from_hash(hash)
  super
  if hash.has_key? 'adValoremRate'
    @ad_valorem_rate = hash['adValoremRate']
  end
  if hash.has_key? 'specificRate'
    @specific_rate = hash['specificRate']
  end
  if hash.has_key? 'surchargeProductTypeId'
    @surcharge_product_type_id = hash['surchargeProductTypeId']
  end
  if hash.has_key? 'surchargeProductTypeVersion'
    @surcharge_product_type_version = hash['surchargeProductTypeVersion']
  end
end

#to_hHash

Returns:

  • (Hash)


24
25
26
27
28
29
30
31
# File 'lib/onlinepayments/sdk/domain/surcharge_rate.rb', line 24

def to_h
  hash = super
  hash['adValoremRate'] = @ad_valorem_rate unless @ad_valorem_rate.nil?
  hash['specificRate'] = @specific_rate unless @specific_rate.nil?
  hash['surchargeProductTypeId'] = @surcharge_product_type_id unless @surcharge_product_type_id.nil?
  hash['surchargeProductTypeVersion'] = @surcharge_product_type_version unless @surcharge_product_type_version.nil?
  hash
end