Class: OpenObject
Instance Method Summary collapse
-
#initialize(source = nil, &block) ⇒ OpenObject
constructor
A new instance of OpenObject.
- #method_missing(symbol, *args) ⇒ Object
Constructor Details
#initialize(source = nil, &block) ⇒ OpenObject
Returns a new instance of OpenObject.
65 66 67 68 |
# File 'lib/buildr/core/util.rb', line 65 def initialize(source=nil, &block) super &block update source if source end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(symbol, *args) ⇒ Object
70 71 72 73 74 75 76 |
# File 'lib/buildr/core/util.rb', line 70 def method_missing(symbol, *args) if symbol.to_s =~ /=$/ self[symbol.to_s[0..-2].to_sym] = args.first else self[symbol] end end |