Class: Clarion::Config
- Inherits:
-
Object
- Object
- Clarion::Config
- Defined in:
- lib/clarion/config.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #counter_options ⇒ Object
-
#initialize(options = {}) ⇒ Config
constructor
A new instance of Config.
- #store_options ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Config
Returns a new instance of Config.
16 17 18 19 20 21 22 23 |
# File 'lib/clarion/config.rb', line 16 def initialize(={}) @options = # Validation self.class..each do |m| send(m) end end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
25 26 27 |
# File 'lib/clarion/config.rb', line 25 def @options end |
Class Method Details
.option(meth) ⇒ Object
7 8 9 |
# File 'lib/clarion/config.rb', line 7 def option(meth) << meth end |
.options ⇒ Object
11 12 13 |
# File 'lib/clarion/config.rb', line 11 def @options ||= [] end |
Instance Method Details
#counter_options ⇒ Object
57 58 59 |
# File 'lib/clarion/config.rb', line 57 def @counter_options ||= @options.fetch(:counter).dup.tap { |_| _.delete(:kind) } end |
#store_options ⇒ Object
47 48 49 |
# File 'lib/clarion/config.rb', line 47 def @store_options ||= @options.fetch(:store).dup.tap { |_| _.delete(:kind) } end |