Class: YaQueen::Config
- Inherits:
-
Object
- Object
- YaQueen::Config
- Defined in:
- lib/ya_queen/config.rb
Instance Method Summary collapse
- #define_server_tasks(name, options = {}) {|t, config| ... } ⇒ Object
-
#initialize(context, path) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(context, path) ⇒ Config
Returns a new instance of Config.
5 6 7 8 |
# File 'lib/ya_queen/config.rb', line 5 def initialize(context, path) @configs = YAML.load_file(path) @context = context end |
Instance Method Details
#define_server_tasks(name, options = {}) {|t, config| ... } ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/ya_queen/config.rb', line 10 def define_server_tasks(name, = {}) config = @configs[name] klass = [:class] || Base t = klass.new(@context, name, @configs) yield(t, config) if block_given? t.define_tasks end |