Class: Few::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/few.rb

Overview

}}}

Instance Method Summary collapse

Constructor Details

#initialize(i) ⇒ Config

{{{



42
43
44
# File 'lib/few.rb', line 42

def initialize(i)
  @c = i
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(n, *a) ⇒ Object



46
47
48
49
50
51
52
53
# File 'lib/few.rb', line 46

def method_missing(n, *a)
  case n.to_s
  when /=$/
    @c[n.to_s.gsub(/=$/, '').to_sym] = a[0]
  else
    @c[n]
  end
end