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.



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

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

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



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_jsonObject



34654
34655
34656
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34654

def to_json
  JSON.dump(to_hash)
end