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.
34644 34645 34646 34647 34648 34649 34650 34651 34652 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34644 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.
34642 34643 34644 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34642 def accept_language @accept_language end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
34642 34643 34644 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34642 def ip @ip end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
34642 34643 34644 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34642 def origin @origin end |
#user_agent ⇒ Object (readonly)
Returns the value of attribute user_agent.
34642 34643 34644 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34642 def user_agent @user_agent end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
34658 34659 34660 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34658 def copy(incoming={}) DeviceDetailsBrowser.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
34662 34663 34664 34665 34666 34667 34668 34669 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34662 def subtype_to_hash { :user_agent => user_agent, :origin => origin, :accept_language => accept_language, :ip => ip } end |
#to_json ⇒ Object
34654 34655 34656 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34654 def to_json JSON.dump(to_hash) end |