Class: Io::Flow::V0::Models::OrderQuoteContact

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 = {}) ⇒ OrderQuoteContact

Returns a new instance of OrderQuoteContact.



52995
52996
52997
52998
52999
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52995

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @email = (x = opts.delete(:email); x.nil? ? nil : HttpClient::Preconditions.assert_class('email', x, String))
  @phone = (x = opts.delete(:phone); x.nil? ? nil : HttpClient::Preconditions.assert_class('phone', x, String))
end

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



52993
52994
52995
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52993

def email
  @email
end

#phoneObject (readonly)

Returns the value of attribute phone.



52993
52994
52995
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52993

def phone
  @phone
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



53005
53006
53007
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53005

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

#to_hashObject



53009
53010
53011
53012
53013
53014
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53009

def to_hash
  {
    :email => email,
    :phone => phone
  }
end

#to_jsonObject



53001
53002
53003
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53001

def to_json
  JSON.dump(to_hash)
end