Class: CBTRUBY::CbtClient::Browser

Inherits:
Object
  • Object
show all
Defined in:
lib/cbt_ruby/browser.rb

Instance Method Summary collapse

Constructor Details

#initialize(browser:, version:, platform: nil, resolution: nil) ⇒ Browser

Returns a new instance of Browser.



3
4
5
6
7
8
# File 'lib/cbt_ruby/browser.rb', line 3

def initialize(browser:, version:, platform: nil, resolution: nil)
  @browser = browser
  @version = version
  @platform = platform
  @resolution = resolution
end

Instance Method Details

#to_sObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/cbt_ruby/browser.rb', line 10

def to_s
  if @platform.nil?
    string = "#{@browser}#{@version}"
    return string
  else
    string = "#{@platform}|#{@browser}#{@version}"
  end
  if @resolution.nil?
    return string
  else
    string += "|#{@resolution}"
    return string
  end
end