class Io::Flow::V0::Models::OrderGeo

The geolocated information for an order

Attributes

country[R]
currency[R]
ip[R]
language[R]

Public Class Methods

new(incoming={}) click to toggle source
# 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

Public Instance Methods

copy(incoming={}) click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 51989
def to_json
  JSON.dump(to_hash)
end