Class: Io::Flow::V0::Models::OrderQuoteAddress

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

Returns a new instance of OrderQuoteAddress.



49081
49082
49083
49084
49085
49086
49087
49088
49089
49090
49091
49092
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49081

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @name = (x = opts.delete(:name); x.nil? ? nil : HttpClient::Preconditions.assert_class('name', x, String))
  @first_name = (x = opts.delete(:first_name); x.nil? ? nil : HttpClient::Preconditions.assert_class('first_name', x, String))
  @last_name = (x = opts.delete(:last_name); x.nil? ? nil : HttpClient::Preconditions.assert_class('last_name', x, String))
  @country = (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, String))
  @streets = (x = opts.delete(:streets); x.nil? ? nil : HttpClient::Preconditions.assert_class('streets', x, Array).map { |v| HttpClient::Preconditions.assert_class('streets', v, String) })
  @city = (x = opts.delete(:city); x.nil? ? nil : HttpClient::Preconditions.assert_class('city', x, String))
  @province = (x = opts.delete(:province); x.nil? ? nil : HttpClient::Preconditions.assert_class('province', x, String))
  @postal = (x = opts.delete(:postal); x.nil? ? nil : HttpClient::Preconditions.assert_class('postal', x, String))
  @company = (x = opts.delete(:company); x.nil? ? nil : HttpClient::Preconditions.assert_class('company', x, String))
end

Instance Attribute Details

#cityObject (readonly)

Returns the value of attribute city.



49079
49080
49081
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49079

def city
  @city
end

#companyObject (readonly)

Returns the value of attribute company.



49079
49080
49081
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49079

def company
  @company
end

#countryObject (readonly)

Returns the value of attribute country.



49079
49080
49081
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49079

def country
  @country
end

#first_nameObject (readonly)

Returns the value of attribute first_name.



49079
49080
49081
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49079

def first_name
  @first_name
end

#last_nameObject (readonly)

Returns the value of attribute last_name.



49079
49080
49081
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49079

def last_name
  @last_name
end

#nameObject (readonly)

Returns the value of attribute name.



49079
49080
49081
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49079

def name
  @name
end

#postalObject (readonly)

Returns the value of attribute postal.



49079
49080
49081
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49079

def postal
  @postal
end

#provinceObject (readonly)

Returns the value of attribute province.



49079
49080
49081
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49079

def province
  @province
end

#streetsObject (readonly)

Returns the value of attribute streets.



49079
49080
49081
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49079

def streets
  @streets
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



49098
49099
49100
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49098

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

#to_hashObject



49102
49103
49104
49105
49106
49107
49108
49109
49110
49111
49112
49113
49114
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49102

def to_hash
  {
    :name => name,
    :first_name => first_name,
    :last_name => last_name,
    :country => country,
    :streets => streets.nil? ? nil : streets,
    :city => city,
    :province => province,
    :postal => postal,
    :company => company
  }
end

#to_jsonObject



49094
49095
49096
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49094

def to_json
  JSON.dump(to_hash)
end