class Scale::Path
Public Instance Methods
close_path()
click to toggle source
# File lib/scale/shapes/path.rb, line 22 def close_path command("Z") end
horizontal(n, relative: false)
click to toggle source
# File lib/scale/shapes/path.rb, line 14 def horizontal(n, relative: false) command("#{relative ? "h" : "H"} #{n}") end
line_to(x:, y:)
click to toggle source
# File lib/scale/shapes/path.rb, line 10 def line_to(x:, y:) command("L #{x} #{y}") end
move_to(x:, y:)
click to toggle source
# File lib/scale/shapes/path.rb, line 6 def move_to(x:, y:) command("M#{x} #{y}") end
vertical(n, relative: false)
click to toggle source
# File lib/scale/shapes/path.rb, line 18 def vertical(n, relative: false) command("#{relative ? "v" : "V"} #{n}") end
xml_tag()
click to toggle source
# File lib/scale/shapes/path.rb, line 26 def xml_tag :path end
Private Instance Methods
command(instructions)
click to toggle source
# File lib/scale/shapes/path.rb, line 32 def command(instructions) if self.d.nil? self.d = instructions else self.d = "#{self.d} #{instructions}" end end