Class: JGrouper::Group
- Inherits:
-
Object
- Object
- JGrouper::Group
- Defined in:
- lib/jgrouper/group.rb
Overview
JGrouper::Group - Grouper Group
Usage
require 'jgrouper'
TODO
Instance Method Summary collapse
-
#initialize(obj = nil) {|_self| ... } ⇒ Group
constructor
A new instance of Group.
-
#method_missing(meth, *args, &block) ⇒ Object
For passing methods on to Grouper Group object.
- #to_s ⇒ Object
Constructor Details
#initialize(obj = nil) {|_self| ... } ⇒ Group
Returns a new instance of Group.
16 17 18 19 20 |
# File 'lib/jgrouper/group.rb', line 16 def initialize( obj = nil ) @obj = obj yield self if block_given? self end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &block) ⇒ Object
For passing methods on to Grouper Group object.
25 26 27 28 29 30 31 32 33 |
# File 'lib/jgrouper/group.rb', line 25 def method_missing(meth, *args, &block) super if @obj.nil? begin block.call @obj.send(meth, *args) if block @obj.send(meth, *args) rescue NoMethodError super end end |
Instance Method Details
#to_s ⇒ Object
35 36 37 38 |
# File 'lib/jgrouper/group.rb', line 35 def to_s return nil if @obj.nil? CSV.generate_line %w( name display_name uuid ).collect { |k| "#{k}=#{ self.send(k) }" } end |