Class: Scale::Path

Inherits:
Object
  • Object
show all
Includes:
Node
Defined in:
lib/scale/shapes/path.rb

Instance Attribute Summary

Attributes included from Node

#content

Instance Method Summary collapse

Methods included from Node

#add, #append_to, #children, #each, #to_xml, #xml_attributes

Instance Method Details

#close_pathObject



22
23
24
# File 'lib/scale/shapes/path.rb', line 22

def close_path
  command("Z")
end

#horizontal(n, relative: false) ⇒ Object



14
15
16
# File 'lib/scale/shapes/path.rb', line 14

def horizontal(n, relative: false)
  command("#{relative ? "h" : "H"} #{n}")
end

#line_to(x:, y:) ⇒ Object



10
11
12
# File 'lib/scale/shapes/path.rb', line 10

def line_to(x:, y:)
  command("L #{x} #{y}")
end

#move_to(x:, y:) ⇒ Object



6
7
8
# File 'lib/scale/shapes/path.rb', line 6

def move_to(x:, y:)
  command("M#{x} #{y}")
end

#vertical(n, relative: false) ⇒ Object



18
19
20
# File 'lib/scale/shapes/path.rb', line 18

def vertical(n, relative: false)
  command("#{relative ? "v" : "V"} #{n}")
end

#xml_tagObject



26
27
28
# File 'lib/scale/shapes/path.rb', line 26

def xml_tag
  :path
end