Class: Io::Flow::V0::Models::PaymentContactBilling

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

Returns a new instance of PaymentContactBilling.



52373
52374
52375
52376
52377
52378
52379
52380
52381
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52373

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:last_name], 'PaymentContactBilling')
  @first_name = (x = opts.delete(:first_name); x.nil? ? nil : HttpClient::Preconditions.assert_class('first_name', x, String))
  @last_name = HttpClient::Preconditions.assert_class('last_name', opts.delete(:last_name), String)
  @company = (x = opts.delete(:company); x.nil? ? nil : HttpClient::Preconditions.assert_class('company', x, String))
  @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

#companyObject (readonly)

Returns the value of attribute company.



52371
52372
52373
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52371

def company
  @company
end

#emailObject (readonly)

Returns the value of attribute email.



52371
52372
52373
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52371

def email
  @email
end

#first_nameObject (readonly)

Returns the value of attribute first_name.



52371
52372
52373
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52371

def first_name
  @first_name
end

#last_nameObject (readonly)

Returns the value of attribute last_name.



52371
52372
52373
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52371

def last_name
  @last_name
end

#phoneObject (readonly)

Returns the value of attribute phone.



52371
52372
52373
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52371

def phone
  @phone
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



52387
52388
52389
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52387

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

#to_hashObject



52391
52392
52393
52394
52395
52396
52397
52398
52399
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52391

def to_hash
  {
    :first_name => first_name,
    :last_name => last_name,
    :company => company,
    :email => email,
    :phone => phone
  }
end

#to_jsonObject



52383
52384
52385
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52383

def to_json
  JSON.dump(to_hash)
end