Class: OnlinePayments::SDK::Domain::BrowserData

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/browser_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#color_depthInteger

Returns the current value of color_depth.

Returns:

  • (Integer)

    the current value of color_depth



14
15
16
# File 'lib/onlinepayments/sdk/domain/browser_data.rb', line 14

def color_depth
  @color_depth
end

#java_enabledtrue/false

Returns the current value of java_enabled.

Returns:

  • (true/false)

    the current value of java_enabled



14
15
16
# File 'lib/onlinepayments/sdk/domain/browser_data.rb', line 14

def java_enabled
  @java_enabled
end

#java_script_enabledtrue/false

Returns the current value of java_script_enabled.

Returns:

  • (true/false)

    the current value of java_script_enabled



14
15
16
# File 'lib/onlinepayments/sdk/domain/browser_data.rb', line 14

def java_script_enabled
  @java_script_enabled
end

#screen_heightString

Returns the current value of screen_height.

Returns:

  • (String)

    the current value of screen_height



14
15
16
# File 'lib/onlinepayments/sdk/domain/browser_data.rb', line 14

def screen_height
  @screen_height
end

#screen_widthString

Returns the current value of screen_width.

Returns:

  • (String)

    the current value of screen_width



14
15
16
# File 'lib/onlinepayments/sdk/domain/browser_data.rb', line 14

def screen_width
  @screen_width
end

Instance Method Details

#from_hash(hash) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/onlinepayments/sdk/domain/browser_data.rb', line 37

def from_hash(hash)
  super
  if hash.has_key? 'colorDepth'
    @color_depth = hash['colorDepth']
  end
  if hash.has_key? 'javaEnabled'
    @java_enabled = hash['javaEnabled']
  end
  if hash.has_key? 'javaScriptEnabled'
    @java_script_enabled = hash['javaScriptEnabled']
  end
  if hash.has_key? 'screenHeight'
    @screen_height = hash['screenHeight']
  end
  if hash.has_key? 'screenWidth'
    @screen_width = hash['screenWidth']
  end
end

#to_hHash

Returns:

  • (Hash)


27
28
29
30
31
32
33
34
35
# File 'lib/onlinepayments/sdk/domain/browser_data.rb', line 27

def to_h
  hash = super
  hash['colorDepth'] = @color_depth unless @color_depth.nil?
  hash['javaEnabled'] = @java_enabled unless @java_enabled.nil?
  hash['javaScriptEnabled'] = @java_script_enabled unless @java_script_enabled.nil?
  hash['screenHeight'] = @screen_height unless @screen_height.nil?
  hash['screenWidth'] = @screen_width unless @screen_width.nil?
  hash
end