Sha256: 5fa1ee4cf261c0ce153ca876becd8af7bdea79fca58ebb6e533bad4cff992168

Contents?: true

Size: 450 Bytes

Versions: 6

Compression:

Stored size: 450 Bytes

Contents

class Prawn::SVG::Elements::Polyline < Prawn::SVG::Elements::Base
  include Prawn::SVG::Pathable

  def parse
    require_attributes('points')
    @points = parse_points(attributes['points'])
  end

  def apply
    apply_commands
    apply_markers
  end

  protected

  def commands
    @commands ||= [
      Prawn::SVG::Pathable::Move.new(@points[0])
    ] + @points[1..].map do |point|
      Prawn::SVG::Pathable::Line.new(point)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
prawn-svg-0.37.0 lib/prawn/svg/elements/polyline.rb
prawn-svg-0.36.2 lib/prawn/svg/elements/polyline.rb
prawn-svg-0.36.1 lib/prawn/svg/elements/polyline.rb
prawn-svg-0.36.0 lib/prawn/svg/elements/polyline.rb
prawn-svg-0.35.1 lib/prawn/svg/elements/polyline.rb
prawn-svg-0.35.0 lib/prawn/svg/elements/polyline.rb