Class: RuPov::Group

Inherits:
Base
  • Object
show all
Defined in:
lib/rupov.rb

Instance Attribute Summary

Attributes inherited from Base

#name

Instance Method Summary collapse

Methods inherited from Base

#<<

Constructor Details

#initialize {|_self| ... } ⇒ Group

Returns a new instance of Group.

Yields:

  • (_self)

Yield Parameters:

  • _self (RuPov::Group)

    the object that the method was called on



24
25
26
27
# File 'lib/rupov.rb', line 24

def initialize
    super( '' )
    yield(self) if block_given? and self.class == Group
end

Instance Method Details

#to_sObject



28
29
30
31
32
# File 'lib/rupov.rb', line 28

def to_s
    result = ''
    @children.each { |child| result << child.to_s.rstrip+"\n" }
    result
end