Class: Mooset::Configuration
- Inherits:
-
Object
- Object
- Mooset::Configuration
- Defined in:
- lib/mooset/configuration.rb
Instance Attribute Summary collapse
-
#config_filename ⇒ Object
readonly
Returns the value of attribute config_filename.
-
#definitions ⇒ Object
readonly
Returns the value of attribute definitions.
-
#tasks ⇒ Object
readonly
Returns the value of attribute tasks.
Instance Method Summary collapse
- #define(name, factory, *args) ⇒ Object
-
#initialize(config_filename) ⇒ Configuration
constructor
A new instance of Configuration.
- #synchronize_users(from: nil, to: nil, query: nil) ⇒ Object
Constructor Details
#initialize(config_filename) ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 9 10 11 |
# File 'lib/mooset/configuration.rb', line 5 def initialize(config_filename) @config_filename = config_filename @definitions = {} @tasks = [] instance_eval File.read(@config_filename), @config_filename end |
Instance Attribute Details
#config_filename ⇒ Object (readonly)
Returns the value of attribute config_filename.
3 4 5 |
# File 'lib/mooset/configuration.rb', line 3 def config_filename @config_filename end |
#definitions ⇒ Object (readonly)
Returns the value of attribute definitions.
3 4 5 |
# File 'lib/mooset/configuration.rb', line 3 def definitions @definitions end |
#tasks ⇒ Object (readonly)
Returns the value of attribute tasks.
3 4 5 |
# File 'lib/mooset/configuration.rb', line 3 def tasks @tasks end |
Instance Method Details
#define(name, factory, *args) ⇒ Object
13 14 15 |
# File 'lib/mooset/configuration.rb', line 13 def define(name, factory, *args) @definitions[name] = Mooset::Endpoints::Endpoint.create(factory, *args) end |
#synchronize_users(from: nil, to: nil, query: nil) ⇒ Object
17 18 19 |
# File 'lib/mooset/configuration.rb', line 17 def synchronize_users(from: nil, to: nil, query: nil) @tasks << { from: from, to: to, query: query } end |