Class: GreenOnion::Configuration
- Inherits:
-
Object
- Object
- GreenOnion::Configuration
- Defined in:
- lib/green_onion/configuration.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#browser ⇒ Object
Uses the driver and dimensions configuration vars to return a Browser object.
- #dimensions ⇒ Object
- #dimensions=(options) ⇒ Object
- #skin_name ⇒ Object
- #skin_name=(options) ⇒ Object
-
#skin_namespace_hash(options = {}) ⇒ Object
Serves as a template for skin_name getter/setter.
Instance Attribute Details
#driver ⇒ Object
22 23 24 |
# File 'lib/green_onion/configuration.rb', line 22 def driver @driver ||= :webkit end |
#skins_dir ⇒ Object
18 19 20 |
# File 'lib/green_onion/configuration.rb', line 18 def skins_dir @skins_dir ||= './spec/skins' end |
#threshold ⇒ Object
14 15 16 |
# File 'lib/green_onion/configuration.rb', line 14 def threshold @threshold ||= 100 end |
Instance Method Details
#browser ⇒ Object
Uses the driver and dimensions configuration vars to return a Browser object
27 28 29 30 31 32 |
# File 'lib/green_onion/configuration.rb', line 27 def browser @browser = Browser.new( :dimensions => dimensions, :driver => driver ) end |
#dimensions ⇒ Object
10 11 12 |
# File 'lib/green_onion/configuration.rb', line 10 def dimensions @dimensions ||= { :height => 768, :width => 1024 } end |
#dimensions=(options) ⇒ Object
6 7 8 |
# File 'lib/green_onion/configuration.rb', line 6 def dimensions=() @dimensions = end |
#skin_name ⇒ Object
38 39 40 |
# File 'lib/green_onion/configuration.rb', line 38 def skin_name @skin_name ||= skin_namespace_hash end |
#skin_name=(options) ⇒ Object
34 35 36 |
# File 'lib/green_onion/configuration.rb', line 34 def skin_name=() @skin_name = skin_namespace_hash() end |
#skin_namespace_hash(options = {}) ⇒ Object
Serves as a template for skin_name getter/setter
43 44 45 46 47 48 49 50 |
# File 'lib/green_onion/configuration.rb', line 43 def skin_namespace_hash( = {}) { :match => [:match] ? [:match] : /[\/]/, :replace => [:replace] ? [:replace] : "_", :prefix => [:prefix] ? [:prefix] : nil, :root => [:root] ? [:root] : "root" } end |