Class: SVG::Path
- Inherits:
-
Object
- Object
- SVG::Path
- Defined in:
- lib/shapes.rb
Instance Method Summary collapse
- #a(rx, ry, x_axis_rot, large_arc_flag, sweep_flag, x, y, relative = true) ⇒ Object
- #c(x1, y1, x2, y2, x, y, relative = false) ⇒ Object
- #h(x, relative = false) ⇒ Object
-
#initialize(svg) ⇒ Path
constructor
A new instance of Path.
- #l(x, y, relative = false) ⇒ Object
- #m(x, y, relative = false) ⇒ Object
- #q(x1, y1, x, y, relative = false) ⇒ Object
- #s(x2, y2, x, y, relative = false) ⇒ Object
- #t(x, y, relative = false) ⇒ Object
- #v(y, relative = false) ⇒ Object
- #z ⇒ Object
Constructor Details
#initialize(svg) ⇒ Path
Returns a new instance of Path.
51 52 53 |
# File 'lib/shapes.rb', line 51 def initialize(svg) @svg = svg end |
Instance Method Details
#a(rx, ry, x_axis_rot, large_arc_flag, sweep_flag, x, y, relative = true) ⇒ Object
87 88 89 |
# File 'lib/shapes.rb', line 87 def a(rx,ry,x_axis_rot,large_arc_flag,sweep_flag,x,y,relative=true) @svg.print %(#{relative ? "a" : "A"} #{rx} #{ry} #{x_axis_rot} #{large_arc_flag} #{sweep_flag} #{x} #{y} ) end |
#c(x1, y1, x2, y2, x, y, relative = false) ⇒ Object
71 72 73 |
# File 'lib/shapes.rb', line 71 def c(x1,y1,x2,y2,x,y,relative=false) @svg.print %(#{relative ? "c" : "C"} #{x1} #{y1} #{x2} #{y2} #{x} #{y} ) end |
#h(x, relative = false) ⇒ Object
63 64 65 |
# File 'lib/shapes.rb', line 63 def h(x,relative=false) @svg.print %(#{relative ? "h" : "H"} #{x} ) end |
#l(x, y, relative = false) ⇒ Object
59 60 61 |
# File 'lib/shapes.rb', line 59 def l(x,y,relative=false) @svg.print %(#{relative ? "l" : "L"} #{x} #{y} ) end |
#m(x, y, relative = false) ⇒ Object
55 56 57 |
# File 'lib/shapes.rb', line 55 def m(x,y,relative=false) @svg.print %(#{relative ? "m" : "M"} #{x} #{y} ) end |
#q(x1, y1, x, y, relative = false) ⇒ Object
79 80 81 |
# File 'lib/shapes.rb', line 79 def q(x1,y1,x,y,relative=false) @svg.print %(#{relative ? "q" : "Q"} #{x1} #{y1} #{x} #{y} ) end |
#s(x2, y2, x, y, relative = false) ⇒ Object
75 76 77 |
# File 'lib/shapes.rb', line 75 def s(x2,y2,x,y,relative=false) @svg.print %(#{relative ? "s" : "S"} #{x2} #{y2} #{x} #{y} ) end |
#t(x, y, relative = false) ⇒ Object
83 84 85 |
# File 'lib/shapes.rb', line 83 def t(x,y,relative=false) @svg.print %(#{relative ? "t" : "T"} #{x} #{y} ) end |
#v(y, relative = false) ⇒ Object
67 68 69 |
# File 'lib/shapes.rb', line 67 def v(y,relative=false) @svg.print %(#{relative ? "v" : "V"} #{y} ) end |
#z ⇒ Object
91 92 93 |
# File 'lib/shapes.rb', line 91 def z() @svg.print %(z ) end |