Class: Io::Flow::V0::Models::OrderCustomerForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OrderCustomerForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#invoice ⇒ Object
readonly
Returns the value of attribute invoice.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#phone ⇒ Object
readonly
Returns the value of attribute phone.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrderCustomerForm
constructor
A new instance of OrderCustomerForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ OrderCustomerForm
Returns a new instance of OrderCustomerForm.
40594 40595 40596 40597 40598 40599 40600 40601 40602 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40594 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) @name = (x = opts.delete(:name); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Name) ? x : ::Io::Flow::V0::Models::Name.new(x))) @number = (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, String)) @phone = (x = opts.delete(:phone); x.nil? ? nil : HttpClient::Preconditions.assert_class('phone', x, String)) @email = (x = opts.delete(:email); x.nil? ? nil : HttpClient::Preconditions.assert_class('email', x, String)) @address = (x = opts.delete(:address); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::BillingAddress) ? x : ::Io::Flow::V0::Models::BillingAddress.new(x))) @invoice = (x = opts.delete(:invoice); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::CustomerInvoice) ? x : ::Io::Flow::V0::Models::CustomerInvoice.new(x))) end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
40592 40593 40594 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40592 def address @address end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
40592 40593 40594 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40592 def email @email end |
#invoice ⇒ Object (readonly)
Returns the value of attribute invoice.
40592 40593 40594 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40592 def invoice @invoice end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
40592 40593 40594 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40592 def name @name end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
40592 40593 40594 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40592 def number @number end |
#phone ⇒ Object (readonly)
Returns the value of attribute phone.
40592 40593 40594 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40592 def phone @phone end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
40608 40609 40610 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40608 def copy(incoming={}) OrderCustomerForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
40612 40613 40614 40615 40616 40617 40618 40619 40620 40621 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40612 def to_hash { :name => name.nil? ? nil : name.to_hash, :number => number, :phone => phone, :email => email, :address => address.nil? ? nil : address.to_hash, :invoice => invoice.nil? ? nil : invoice.to_hash } end |
#to_json ⇒ Object
40604 40605 40606 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40604 def to_json JSON.dump(to_hash) end |