Class: ProjectGroup::DSLWrapper

Inherits:
Object
  • Object
show all
Includes:
FromHash
Defined in:
lib/project_group/config.rb

Direct Known Subclasses

GroupWrapper

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#objObject

Returns the value of attribute obj.



4
5
6
# File 'lib/project_group/config.rb', line 4

def obj
  @obj
end