Class: Io::Flow::V0::Models::ShippingAddress
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ShippingAddress
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#contact ⇒ Object
readonly
Returns the value of attribute contact.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ShippingAddress
constructor
A new instance of ShippingAddress.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ShippingAddress
Returns a new instance of ShippingAddress.
25280 25281 25282 25283 25284 25285 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25280 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:contact, :location], 'ShippingAddress') @contact = (x = opts.delete(:contact); x.is_a?(::Io::Flow::V0::Models::Contact) ? x : ::Io::Flow::V0::Models::Contact.new(x)) @location = (x = opts.delete(:location); x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x)) end |
Instance Attribute Details
#contact ⇒ Object (readonly)
Returns the value of attribute contact.
25278 25279 25280 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25278 def contact @contact end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
25278 25279 25280 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25278 def location @location end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
25291 25292 25293 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25291 def copy(incoming={}) ShippingAddress.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
25295 25296 25297 25298 25299 25300 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25295 def to_hash { :contact => contact.to_hash, :location => location.to_hash } end |
#to_json ⇒ Object
25287 25288 25289 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25287 def to_json JSON.dump(to_hash) end |