Class: RSVGR::Path

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

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Path

Returns a new instance of Path.



52
53
54
55
# File 'lib/rsvgr.rb', line 52

def initialize args = {}
  @fill_color = "none"
  super
end

Instance Method Details

#to_sObject



56
57
58
59
60
61
62
63
64
65
# File 'lib/rsvgr.rb', line 56

def to_s
  "<path"                                                                 +
  " d=\"#{@d || "M " + @points.map{ |x, y|
    "#{DEFAULT_SIZE * x} #{DEFAULT_SIZE * y}"
    }.join(" L ")}\""  +
  "#{" stroke=\"#{@stroke_color}\"" if @stroke_color}"                    +
  "#{" stroke-width=\"#{@stroke_width}\"" if @stroke_width}"              +
  " fill=\"#{@fill_color}\""                                              +
  "/>\n"
end