Class: Io::Flow::V0::Models::DeviceDetailsBrowser

Inherits:
DeviceDetails
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Attributes inherited from DeviceDetails

#type

Instance Method Summary collapse

Methods inherited from DeviceDetails

from_json, #to_hash

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_languageObject (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

#ipObject (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

#originObject (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_agentObject (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_hashObject



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_jsonObject



36439
36440
36441
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36439

def to_json
  JSON.dump(to_hash)
end