Class: Knot::Path
- Inherits:
-
Object
- Object
- Knot::Path
- Defined in:
- lib/knot/path.rb
Overview
Models an SVG path.
Instance Method Summary collapse
- #a(rx, ry, x_axis_rotation, large_arc, sweep, m) ⇒ Object
- #A(rx, ry, x_axis_rotation, large_arc, sweep, m) ⇒ Object
-
#initialize ⇒ Path
constructor
A new instance of Path.
- #L(m) ⇒ Object
- #l(m) ⇒ Object
- #M(m) ⇒ Object
- #m(m) ⇒ Object
- #z ⇒ Object
Constructor Details
#initialize ⇒ Path
Returns a new instance of Path.
6 7 8 |
# File 'lib/knot/path.rb', line 6 def initialize @path = [] end |
Instance Method Details
#a(rx, ry, x_axis_rotation, large_arc, sweep, m) ⇒ Object
30 31 32 |
# File 'lib/knot/path.rb', line 30 def a(rx, ry, x_axis_rotation, large_arc, sweep, m) @path.push __method__, rx, ry, x_axis_rotation, large_arc, sweep, m.x, m.y end |
#A(rx, ry, x_axis_rotation, large_arc, sweep, m) ⇒ Object
26 27 28 |
# File 'lib/knot/path.rb', line 26 def A(rx, ry, x_axis_rotation, large_arc, sweep, m) @path.push __method__, rx, ry, x_axis_rotation, large_arc, sweep, m.x, m.y end |
#L(m) ⇒ Object
18 19 20 |
# File 'lib/knot/path.rb', line 18 def L(m) @path.push __method__, m.x, m.y end |
#l(m) ⇒ Object
22 23 24 |
# File 'lib/knot/path.rb', line 22 def l(m) @path.push __method__, m.x, m.y end |
#M(m) ⇒ Object
10 11 12 |
# File 'lib/knot/path.rb', line 10 def M(m) @path.push __method__, m.x, m.y end |
#m(m) ⇒ Object
14 15 16 |
# File 'lib/knot/path.rb', line 14 def m(m) @path.push __method__, m.x, m.y end |
#z ⇒ Object
34 35 36 37 |
# File 'lib/knot/path.rb', line 34 def z @path.push 'z' @path.join(' ') end |