class Prawn::SVG::Elements::Polygon

Public Instance Methods

apply() click to toggle source
# File lib/prawn/svg/elements/polygon.rb, line 9
def apply
  apply_commands
  apply_markers
end
parse() click to toggle source
# File lib/prawn/svg/elements/polygon.rb, line 4
def parse
  require_attributes('points')
  @points = parse_points(attributes['points'])
end

Protected Instance Methods

commands() click to toggle source
# File lib/prawn/svg/elements/polygon.rb, line 16
def commands
  @commands ||= [
    Prawn::SVG::Pathable::Move.new(@points[0])
  ] + @points[1..-1].map { |point|
    Prawn::SVG::Pathable::Line.new(point)
  } + [
    Prawn::SVG::Pathable::Close.new(@points[0])
  ]
end