Class: Statistrano::Config
- Inherits:
-
Object
- Object
- Statistrano::Config
- Includes:
- RakeTaskWithContextCreation
- Defined in:
- lib/statistrano/config.rb,
lib/statistrano/config/configurable.rb,
lib/statistrano/config/rake_task_with_context_creation.rb
Defined Under Namespace
Modules: Configurable, RakeTaskWithContextCreation Classes: ValidationError
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#tasks ⇒ Object
readonly
Returns the value of attribute tasks.
-
#validators ⇒ Object
readonly
Returns the value of attribute validators.
Instance Method Summary collapse
-
#initialize(options: nil, tasks: nil, validators: nil) ⇒ Config
constructor
initalize with the potential for seed options this is required so that when config’d classes are extended we can pass that configuration along.
Methods included from RakeTaskWithContextCreation
Constructor Details
#initialize(options: nil, tasks: nil, validators: nil) ⇒ Config
initalize with the potential for seed options this is required so that when config’d classes are extended we can pass that configuration along
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/statistrano/config.rb', line 15 def initialize options: nil, tasks: nil, validators: nil @options = .nil? ? {} : .clone @tasks = tasks.nil? ? {} : tasks.clone @validators = validators.nil? ? {} : validators.clone @options.each do |key,val| define_option_accessor key.to_sym end @validators.each do |key,val| define_validator key.to_sym end end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/statistrano/config.rb', line 8 def @options end |
#tasks ⇒ Object (readonly)
Returns the value of attribute tasks.
8 9 10 |
# File 'lib/statistrano/config.rb', line 8 def tasks @tasks end |
#validators ⇒ Object (readonly)
Returns the value of attribute validators.
8 9 10 |
# File 'lib/statistrano/config.rb', line 8 def validators @validators end |