Class: Mistilteinn::Config::WrapObj
- Inherits:
-
Object
- Object
- Mistilteinn::Config::WrapObj
- Defined in:
- lib/mistilteinn/config.rb
Instance Method Summary collapse
-
#initialize(name, hash) ⇒ WrapObj
constructor
A new instance of WrapObj.
- #method_missing(name, *args) ⇒ Object
Constructor Details
#initialize(name, hash) ⇒ WrapObj
Returns a new instance of WrapObj.
40 41 42 43 |
# File 'lib/mistilteinn/config.rb', line 40 def initialize(name, hash) @name = name @hash = hash end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/mistilteinn/config.rb', line 45 def method_missing(name, *args) key = name.to_s super(name, *args) unless args.empty? @hash[key] or ::Mistilteinn::Git.config("#{@name}.#{key}") or raise ConfigError.new("no config(#{@name}.#{key})") end |