Class: SVG::Group
- Inherits:
-
ElementBase
- Object
- ElementBase
- SVG::Group
- Includes:
- ArrayMixin
- Defined in:
- lib/ruby-svg/element.rb
Overview
#
Group Class
Instance Attribute Summary collapse
-
#elements ⇒ Object
readonly
Returns the value of attribute elements.
Attributes inherited from ElementBase
#attr, #class, #id, #style, #transform
Instance Method Summary collapse
-
#initialize ⇒ Group
constructor
A new instance of Group.
- #to_s ⇒ Object
Methods included from ArrayMixin
#<<, #[], #[]=, #clear, #each, #first, #last
Constructor Details
#initialize ⇒ Group
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
#elements ⇒ Object (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_s ⇒ Object
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 |