Class: CBTRUBY::CbtClient::Browser
- Inherits:
-
Object
- Object
- CBTRUBY::CbtClient::Browser
- Defined in:
- lib/cbt_ruby/browser.rb
Instance Method Summary collapse
-
#initialize(browser:, version:, platform: nil, resolution: nil) ⇒ Browser
constructor
A new instance of Browser.
- #to_s ⇒ Object
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_s ⇒ Object
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 |