Class: RSVGR::Path
- Inherits:
-
Object
- Object
- RSVGR::Path
- Defined in:
- lib/rsvgr.rb
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Path
constructor
A new instance of Path.
- #to_s ⇒ Object
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_s ⇒ Object
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 |