Module: SVGen::Nestable

Included in:
Element::Group, SVG
Defined in:
lib/svgen/nestable.rb

Instance Method Summary collapse

Instance Method Details

#circle(attrs = {}) ⇒ Object



7
8
9
# File 'lib/svgen/nestable.rb', line 7

def circle(attrs = {})
  @children << Element::Circle.new(attrs)
end

#group(attrs = {}, &block) ⇒ Object Also known as: g



23
24
25
# File 'lib/svgen/nestable.rb', line 23

def group(attrs = {}, &block)
  @children << Element::Group.new(attrs, &block)
end

#line(attrs = {}) ⇒ Object



15
16
17
# File 'lib/svgen/nestable.rb', line 15

def line(attrs = {})
  @children << Element::Line.new(attrs)
end

#path(attrs = {}) ⇒ Object



19
20
21
# File 'lib/svgen/nestable.rb', line 19

def path(attrs = {})
  @children << Element::Path.new(attrs)
end

#rect(attrs = {}) ⇒ Object



3
4
5
# File 'lib/svgen/nestable.rb', line 3

def rect(attrs = {})
  @children << Element::Rect.new(attrs)
end

#text(text, attrs = {}) ⇒ Object



11
12
13
# File 'lib/svgen/nestable.rb', line 11

def text(text, attrs = {})
  @children << Element::Text.new(text, attrs)
end