Class: Ion::Config
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Ion::Config
- Defined in:
- lib/ion/config.rb
Instance Method Summary collapse
- #defaults ⇒ Object
-
#initialize(args = {}) ⇒ Config
constructor
A new instance of Config.
- #method_missing(meth, *args, &blk) ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Config
Returns a new instance of Config.
2 3 4 |
# File 'lib/ion/config.rb', line 2 def initialize(args={}) super defaults.merge(args) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &blk) ⇒ Object
12 13 14 15 |
# File 'lib/ion/config.rb', line 12 def method_missing(meth, *args, &blk) return @table.keys.include?(meth[0...-1].to_sym) if meth.to_s[-1] == '?' super end |
Instance Method Details
#defaults ⇒ Object
6 7 8 9 10 |
# File 'lib/ion/config.rb', line 6 def defaults @defaults ||= { :ignored_words => %w(a it at the) } end |