Class: Janus::Browser

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Browser

Returns a new instance of Browser.



5
6
7
8
9
# File 'lib/janus/browser.rb', line 5

def initialize(attributes = {})
  @platform = attributes['platform']
  @name = attributes['name']
  @version = attributes['version']
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/janus/browser.rb', line 3

def name
  @name
end

#platformObject (readonly)

Returns the value of attribute platform.



3
4
5
# File 'lib/janus/browser.rb', line 3

def platform
  @platform
end

#versionObject (readonly)

Returns the value of attribute version.



3
4
5
# File 'lib/janus/browser.rb', line 3

def version
  @version
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/janus/browser.rb', line 11

def eql?(other)
  platform == other.platform && name == other.name && version == other.version
end

#to_sObject



15
16
17
# File 'lib/janus/browser.rb', line 15

def to_s
  "#{platform}, #{name} #{version}".strip
end