Class: Io::Flow::V0::Models::OrderCustomerForm

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ OrderCustomerForm

Returns a new instance of OrderCustomerForm.



39861
39862
39863
39864
39865
39866
39867
39868
39869
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39861

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

#addressObject (readonly)

Returns the value of attribute address.



39859
39860
39861
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39859

def address
  @address
end

#emailObject (readonly)

Returns the value of attribute email.



39859
39860
39861
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39859

def email
  @email
end

#invoiceObject (readonly)

Returns the value of attribute invoice.



39859
39860
39861
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39859

def invoice
  @invoice
end

#nameObject (readonly)

Returns the value of attribute name.



39859
39860
39861
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39859

def name
  @name
end

#numberObject (readonly)

Returns the value of attribute number.



39859
39860
39861
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39859

def number
  @number
end

#phoneObject (readonly)

Returns the value of attribute phone.



39859
39860
39861
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39859

def phone
  @phone
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



39875
39876
39877
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39875

def copy(incoming={})
  OrderCustomerForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



39879
39880
39881
39882
39883
39884
39885
39886
39887
39888
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39879

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_jsonObject



39871
39872
39873
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39871

def to_json
  JSON.dump(to_hash)
end