Class: ProjectGroup::DSLWrapper
- Inherits:
-
Object
- Object
- ProjectGroup::DSLWrapper
- Includes:
- FromHash
- Defined in:
- lib/project_group/config.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#obj ⇒ Object
Returns the value of attribute obj.
Instance Method Summary collapse
-
#initialize(obj) ⇒ DSLWrapper
constructor
A new instance of DSLWrapper.
- #method_missing(sym, *args, &b) ⇒ Object
Constructor Details
#initialize(obj) ⇒ DSLWrapper
Returns a new instance of DSLWrapper.
5 6 7 |
# File 'lib/project_group/config.rb', line 5 def initialize(obj) @obj = obj end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args, &b) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/project_group/config.rb', line 8 def method_missing(sym,*args,&b) if args.empty? obj.send sym else obj.send "#{sym}=",args.first end end |
Instance Attribute Details
#obj ⇒ Object
Returns the value of attribute obj.
4 5 6 |
# File 'lib/project_group/config.rb', line 4 def obj @obj end |