Class: SVG::Group

Inherits:
ElementBase show all
Includes:
ArrayMixin
Defined in:
lib/ruby-svg/element.rb

Overview

#

Group Class

Instance Attribute Summary collapse

Attributes inherited from ElementBase

#attr, #class, #id, #style, #transform

Instance Method Summary collapse

Methods included from ArrayMixin

#<<, #[], #[]=, #clear, #each, #first, #last

Constructor Details

#initializeGroup

Returns a new instance of Group.



47
48
49
50
# File 'lib/ruby-svg/element.rb', line 47

def initialize
  super()
  @elements = []
end

Instance Attribute Details

#elementsObject (readonly)

Returns the value of attribute elements.



52
53
54
# File 'lib/ruby-svg/element.rb', line 52

def elements
  @elements
end

Instance Method Details

#to_sObject



59
60
61
62
63
64
65
# File 'lib/ruby-svg/element.rb', line 59

def to_s
 text = %|<g|
 text << super()
 text << %|>\n|
 text << @elements.collect { |element| element.to_s + "\n" }.join
 text << %|</g>\n|
end