Class: Saucer::PlatformConfiguration
- Inherits:
-
Object
- Object
- Saucer::PlatformConfiguration
- Defined in:
- lib/saucer/platform_configuration.rb
Instance Attribute Summary collapse
-
#browser ⇒ Object
Returns the value of attribute browser.
-
#browser_version ⇒ Object
Returns the value of attribute browser_version.
-
#os ⇒ Object
Returns the value of attribute os.
Instance Method Summary collapse
-
#initialize(opt = {}) ⇒ PlatformConfiguration
constructor
A new instance of PlatformConfiguration.
- #name ⇒ Object
- #to_hash ⇒ Object
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
#browser ⇒ Object
Returns the value of attribute browser.
5 6 7 |
# File 'lib/saucer/platform_configuration.rb', line 5 def browser @browser end |
#browser_version ⇒ Object
Returns the value of attribute browser_version.
5 6 7 |
# File 'lib/saucer/platform_configuration.rb', line 5 def browser_version @browser_version end |
#os ⇒ Object
Returns the value of attribute os.
5 6 7 |
# File 'lib/saucer/platform_configuration.rb', line 5 def os @os end |
Instance Method Details
#name ⇒ Object
17 18 19 |
# File 'lib/saucer/platform_configuration.rb', line 17 def name "#{@os}_#{@browser}_#{@browser_version}".to_sym end |
#to_hash ⇒ Object
13 14 15 |
# File 'lib/saucer/platform_configuration.rb', line 13 def to_hash Platform.send(@os).send(@browser).send("v#{@browser_version}") end |