Class: Ingenico::Direct::SDK::Domain::Shipping
- Inherits:
-
Ingenico::Direct::SDK::DataObject
- Object
- Ingenico::Direct::SDK::DataObject
- Ingenico::Direct::SDK::Domain::Shipping
- Defined in:
- lib/ingenico/direct/sdk/domain/shipping.rb
Instance Attribute Summary collapse
-
#address ⇒ Ingenico::Direct::SDK::Domain::AddressPersonal
The current value of address.
-
#address_indicator ⇒ String
The current value of address_indicator.
-
#email_address ⇒ String
The current value of email_address.
-
#first_usage_date ⇒ String
The current value of first_usage_date.
-
#is_first_usage ⇒ true/false
The current value of is_first_usage.
-
#shipping_cost ⇒ Long
The current value of shipping_cost.
-
#shipping_cost_tax ⇒ Long
The current value of shipping_cost_tax.
-
#type ⇒ String
The current value of type.
Instance Method Summary collapse
Methods inherited from Ingenico::Direct::SDK::DataObject
Instance Attribute Details
#address ⇒ Ingenico::Direct::SDK::Domain::AddressPersonal
Returns the current value of address.
19 20 21 |
# File 'lib/ingenico/direct/sdk/domain/shipping.rb', line 19 def address @address end |
#address_indicator ⇒ String
Returns the current value of address_indicator.
19 20 21 |
# File 'lib/ingenico/direct/sdk/domain/shipping.rb', line 19 def address_indicator @address_indicator end |
#email_address ⇒ String
Returns the current value of email_address.
19 20 21 |
# File 'lib/ingenico/direct/sdk/domain/shipping.rb', line 19 def email_address @email_address end |
#first_usage_date ⇒ String
Returns the current value of first_usage_date.
19 20 21 |
# File 'lib/ingenico/direct/sdk/domain/shipping.rb', line 19 def first_usage_date @first_usage_date end |
#is_first_usage ⇒ true/false
Returns the current value of is_first_usage.
19 20 21 |
# File 'lib/ingenico/direct/sdk/domain/shipping.rb', line 19 def is_first_usage @is_first_usage end |
#shipping_cost ⇒ Long
Returns the current value of shipping_cost.
19 20 21 |
# File 'lib/ingenico/direct/sdk/domain/shipping.rb', line 19 def shipping_cost @shipping_cost end |
#shipping_cost_tax ⇒ Long
Returns the current value of shipping_cost_tax.
19 20 21 |
# File 'lib/ingenico/direct/sdk/domain/shipping.rb', line 19 def shipping_cost_tax @shipping_cost_tax end |
#type ⇒ String
Returns the current value of type.
19 20 21 |
# File 'lib/ingenico/direct/sdk/domain/shipping.rb', line 19 def type @type end |
Instance Method Details
#from_hash(hash) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/ingenico/direct/sdk/domain/shipping.rb', line 43 def from_hash(hash) super if hash.key? 'address' raise TypeError, "value '%s' is not a Hash" % [hash['address']] unless hash['address'].is_a? Hash @address = Ingenico::Direct::SDK::Domain::AddressPersonal.new_from_hash(hash['address']) end @address_indicator = hash['addressIndicator'] if hash.key? 'addressIndicator' @email_address = hash['emailAddress'] if hash.key? 'emailAddress' @first_usage_date = hash['firstUsageDate'] if hash.key? 'firstUsageDate' @is_first_usage = hash['isFirstUsage'] if hash.key? 'isFirstUsage' @shipping_cost = hash['shippingCost'] if hash.key? 'shippingCost' @shipping_cost_tax = hash['shippingCostTax'] if hash.key? 'shippingCostTax' @type = hash['type'] if hash.key? 'type' end |
#to_h ⇒ Hash
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/ingenico/direct/sdk/domain/shipping.rb', line 30 def to_h hash = super hash['address'] = @address.to_h if @address hash['addressIndicator'] = @address_indicator unless @address_indicator.nil? hash['emailAddress'] = @email_address unless @email_address.nil? hash['firstUsageDate'] = @first_usage_date unless @first_usage_date.nil? hash['isFirstUsage'] = @is_first_usage unless @is_first_usage.nil? hash['shippingCost'] = @shipping_cost unless @shipping_cost.nil? hash['shippingCostTax'] = @shipping_cost_tax unless @shipping_cost_tax.nil? hash['type'] = @type unless @type.nil? hash end |