Class: Io::Flow::V0::Models::PaymentContactShipping

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

Returns a new instance of PaymentContactShipping.



56644
56645
56646
56647
56648
56649
56650
56651
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56644

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:last_name, :email], 'PaymentContactShipping')
  @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)
  @email = HttpClient::Preconditions.assert_class('email', opts.delete(:email), 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.



56642
56643
56644
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56642

def email
  @email
end

#first_nameObject (readonly)

Returns the value of attribute first_name.



56642
56643
56644
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56642

def first_name
  @first_name
end

#last_nameObject (readonly)

Returns the value of attribute last_name.



56642
56643
56644
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56642

def last_name
  @last_name
end

#phoneObject (readonly)

Returns the value of attribute phone.



56642
56643
56644
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56642

def phone
  @phone
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



56657
56658
56659
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56657

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

#to_hashObject



56661
56662
56663
56664
56665
56666
56667
56668
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56661

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

#to_jsonObject



56653
56654
56655
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56653

def to_json
  JSON.dump(to_hash)
end