Class: Io::Flow::V0::Models::OrderQuoteAddress
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OrderQuoteAddress
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#company ⇒ Object
readonly
Returns the value of attribute company.
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#first_name ⇒ Object
readonly
Returns the value of attribute first_name.
-
#last_name ⇒ Object
readonly
Returns the value of attribute last_name.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#postal ⇒ Object
readonly
Returns the value of attribute postal.
-
#province ⇒ Object
readonly
Returns the value of attribute province.
-
#streets ⇒ Object
readonly
Returns the value of attribute streets.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrderQuoteAddress
constructor
A new instance of OrderQuoteAddress.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ OrderQuoteAddress
Returns a new instance of OrderQuoteAddress.
52954 52955 52956 52957 52958 52959 52960 52961 52962 52963 52964 52965 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52954 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
#city ⇒ Object (readonly)
Returns the value of attribute city.
52952 52953 52954 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52952 def city @city end |
#company ⇒ Object (readonly)
Returns the value of attribute company.
52952 52953 52954 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52952 def company @company end |
#country ⇒ Object (readonly)
Returns the value of attribute country.
52952 52953 52954 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52952 def country @country end |
#first_name ⇒ Object (readonly)
Returns the value of attribute first_name.
52952 52953 52954 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52952 def first_name @first_name end |
#last_name ⇒ Object (readonly)
Returns the value of attribute last_name.
52952 52953 52954 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52952 def last_name @last_name end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
52952 52953 52954 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52952 def name @name end |
#postal ⇒ Object (readonly)
Returns the value of attribute postal.
52952 52953 52954 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52952 def postal @postal end |
#province ⇒ Object (readonly)
Returns the value of attribute province.
52952 52953 52954 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52952 def province @province end |
#streets ⇒ Object (readonly)
Returns the value of attribute streets.
52952 52953 52954 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52952 def streets @streets end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
52971 52972 52973 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52971 def copy(incoming={}) OrderQuoteAddress.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
52975 52976 52977 52978 52979 52980 52981 52982 52983 52984 52985 52986 52987 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52975 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_json ⇒ Object
52967 52968 52969 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52967 def to_json JSON.dump(to_hash) end |