Class: Io::Flow::V0::Models::BillingAddress
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::BillingAddress
- 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.
-
#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 = {}) ⇒ BillingAddress
constructor
A new instance of BillingAddress.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ BillingAddress
Returns a new instance of BillingAddress.
24427 24428 24429 24430 24431 24432 24433 24434 24435 24436 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24427 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) @name = (x = opts.delete(:name); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Name) ? x : ::Io::Flow::V0::Models::Name.new(x))) @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)) @country = (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', 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.
24425 24426 24427 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24425 def city @city end |
#company ⇒ Object (readonly)
Returns the value of attribute company.
24425 24426 24427 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24425 def company @company end |
#country ⇒ Object (readonly)
Returns the value of attribute country.
24425 24426 24427 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24425 def country @country end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
24425 24426 24427 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24425 def name @name end |
#postal ⇒ Object (readonly)
Returns the value of attribute postal.
24425 24426 24427 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24425 def postal @postal end |
#province ⇒ Object (readonly)
Returns the value of attribute province.
24425 24426 24427 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24425 def province @province end |
#streets ⇒ Object (readonly)
Returns the value of attribute streets.
24425 24426 24427 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24425 def streets @streets end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
24442 24443 24444 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24442 def copy(incoming={}) BillingAddress.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
24446 24447 24448 24449 24450 24451 24452 24453 24454 24455 24456 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24446 def to_hash { :name => name.nil? ? nil : name.to_hash, :streets => streets.nil? ? nil : streets, :city => city, :province => province, :postal => postal, :country => country, :company => company } end |
#to_json ⇒ Object
24438 24439 24440 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24438 def to_json JSON.dump(to_hash) end |