Class: Saucer::PlatformConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/saucer/platform_configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opt = {}) ⇒ PlatformConfiguration

Returns a new instance of PlatformConfiguration.



7
8
9
10
11
# File 'lib/saucer/platform_configuration.rb', line 7

def initialize(opt = {})
  @browser = opt[:browser]
  @os = opt[:os] || opt['os'].downcase.tr(' ', '_').tr(',', '_')
  @browser_version = opt[:browser_version] || opt['short_version']
end

Instance Attribute Details

#browserObject

Returns the value of attribute browser.



5
6
7
# File 'lib/saucer/platform_configuration.rb', line 5

def browser
  @browser
end

#browser_versionObject

Returns the value of attribute browser_version.



5
6
7
# File 'lib/saucer/platform_configuration.rb', line 5

def browser_version
  @browser_version
end

#osObject

Returns the value of attribute os.



5
6
7
# File 'lib/saucer/platform_configuration.rb', line 5

def os
  @os
end

Instance Method Details

#nameObject



17
18
19
# File 'lib/saucer/platform_configuration.rb', line 17

def name
  "#{@os}_#{@browser}_#{@browser_version}".to_sym
end

#to_hashObject



13
14
15
# File 'lib/saucer/platform_configuration.rb', line 13

def to_hash
  Platform.send(@os).send(@browser).send("v#{@browser_version}")
end