Class: ProductSpy::Configuration
- Inherits:
-
Object
- Object
- ProductSpy::Configuration
- Includes:
- Singleton
- Defined in:
- lib/product_spy/configuration.rb
Instance Attribute Summary collapse
-
#hosts ⇒ Object
readonly
Returns the value of attribute hosts.
Instance Method Summary collapse
- #host(host, options = {}) {|host_inst| ... } ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
7 8 9 |
# File 'lib/product_spy/configuration.rb', line 7 def initialize @hosts = {} end |
Instance Attribute Details
#hosts ⇒ Object (readonly)
Returns the value of attribute hosts.
5 6 7 |
# File 'lib/product_spy/configuration.rb', line 5 def hosts @hosts end |
Instance Method Details
#host(host, options = {}) {|host_inst| ... } ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/product_spy/configuration.rb', line 11 def host(host, = {}, &block) host_inst = Host.new(host) yield host_inst @hosts[host.to_sym] = host_inst = { :aliases => [] }.merge() [:aliases].each do |host| @hosts[host.to_sym] = host_inst end end |