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.
51980 51981 51982 51983 51984 51985 51986 51987 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51980 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.
51978 51979 51980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51978 def country @country end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
51978 51979 51980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51978 def currency @currency end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
51978 51979 51980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51978 def ip @ip end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
51978 51979 51980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51978 def language @language end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
51993 51994 51995 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51993 def copy(incoming={}) OrderGeo.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
51997 51998 51999 52000 52001 52002 52003 52004 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51997 def to_hash { :ip => ip, :country => country, :currency => currency, :language => language } end |
#to_json ⇒ Object
51989 51990 51991 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51989 def to_json JSON.dump(to_hash) end |