Class: Io::Flow::V0::Models::OrderGeo
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OrderGeo
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
The geolocated information for an order
Instance Attribute Summary collapse
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrderGeo
constructor
A new instance of OrderGeo.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ OrderGeo
Returns a new instance of OrderGeo.
30848 30849 30850 30851 30852 30853 30854 30855 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30848 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:country], 'OrderGeo') @ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String)) @country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String) @currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String)) @language = (x = opts.delete(:language); x.nil? ? nil : HttpClient::Preconditions.assert_class('language', x, String)) end |
Instance Attribute Details
#country ⇒ Object (readonly)
Returns the value of attribute country.
30846 30847 30848 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30846 def country @country end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
30846 30847 30848 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30846 def currency @currency end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
30846 30847 30848 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30846 def ip @ip end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
30846 30847 30848 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30846 def language @language end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
30861 30862 30863 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30861 def copy(incoming={}) OrderGeo.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
30865 30866 30867 30868 30869 30870 30871 30872 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30865 def to_hash { :ip => ip, :country => country, :currency => currency, :language => language } end |
#to_json ⇒ Object
30857 30858 30859 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30857 def to_json JSON.dump(to_hash) end |