Class: Ion::Config

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/ion/config.rb

Instance Method Summary collapse

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

#defaultsObject



6
7
8
9
10
# File 'lib/ion/config.rb', line 6

def defaults
  @defaults ||= {
    :ignored_words => %w(a it at the)
  }
end