Class: Io::Flow::V0::Models::DeviceDetailsBrowser
- Inherits:
-
DeviceDetails
- Object
- DeviceDetails
- Io::Flow::V0::Models::DeviceDetailsBrowser
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#accept_language ⇒ Object
readonly
Returns the value of attribute accept_language.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
-
#user_agent ⇒ Object
readonly
Returns the value of attribute user_agent.
Attributes inherited from DeviceDetails
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ DeviceDetailsBrowser
constructor
A new instance of DeviceDetailsBrowser.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from DeviceDetails
Constructor Details
#initialize(incoming = {}) ⇒ DeviceDetailsBrowser
Returns a new instance of DeviceDetailsBrowser.
36429 36430 36431 36432 36433 36434 36435 36436 36437 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36429 def initialize(incoming={}) super(:type => DeviceDetails::Types::DEVICE_DETAILS_BROWSER) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:user_agent, :origin, :accept_language], 'DeviceDetailsBrowser') @user_agent = HttpClient::Preconditions.assert_class('user_agent', opts.delete(:user_agent), String) @origin = HttpClient::Preconditions.assert_class('origin', opts.delete(:origin), String) @accept_language = HttpClient::Preconditions.assert_class('accept_language', opts.delete(:accept_language), String) @ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String)) end |
Instance Attribute Details
#accept_language ⇒ Object (readonly)
Returns the value of attribute accept_language.
36427 36428 36429 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36427 def accept_language @accept_language end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
36427 36428 36429 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36427 def ip @ip end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
36427 36428 36429 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36427 def origin @origin end |
#user_agent ⇒ Object (readonly)
Returns the value of attribute user_agent.
36427 36428 36429 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36427 def user_agent @user_agent end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
36443 36444 36445 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36443 def copy(incoming={}) DeviceDetailsBrowser.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
36447 36448 36449 36450 36451 36452 36453 36454 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36447 def subtype_to_hash { :user_agent => user_agent, :origin => origin, :accept_language => accept_language, :ip => ip } end |
#to_json ⇒ Object
36439 36440 36441 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36439 def to_json JSON.dump(to_hash) end |