Sha256: 5ba102c3bd296e5481081baabfbae5ffb51096612d52dfd6bfe0d990f67c21ab

Contents?: true

Size: 484 Bytes

Versions: 2

Compression:

Stored size: 484 Bytes

Contents

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

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

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

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
svgen-0.0.3 lib/svgen/nestable.rb
svgen-0.0.2 lib/svgen/nestable.rb