lib/chunky_png/vector.rb
# Iterates over all the edges in this vector.
#
# An edge is a combination of two subsequent points in the vector. Together, they will form
# a path from the first point to the last point
#
# @param [true, false] close Whether to close the path, i.e. return an edge that connects the last
#   point in the vector back to the first point.
# @return [void]
# @raise [ChunkyPNG::ExpectationFailed] if the vector contains less than two points.
# @see #edges
Iterates over all the edges in this vector.
An edge is a combination of two subsequent points in the vector. Together, they will form
a path from the first point to the last point
Iterates over all the edges in this vector . An edge is a combination of two subsequent points in the vector . Together they will form a path from the first point to the last point
def each_edge(close = true)
      raise ChunkyPNG::ExpectationFailed, "Not enough points in this path to draw an edge!" if length < 2
      points.each_cons(2) { |a, b| yield(a, b) }
      yield(points.last, points.first) if close
    end
def each_edge ( close = true ) raise ChunkyPNG :: ExpectationFailed , "Not enough points in this path to draw an edge!" if length < 2 points . each_cons ( 2 ) { | a , b | yield ( a , b ) } yield ( points . last , points . first ) if close end
Iterates over all the edges in this vector.
Iterates over all the edges in this vector .
None
void
[ChunkyPNG::ExpectationFailed] if the vector contains less than two points.
[ ChunkyPNG :: ExpectationFailed ] if the vector contains less than two points .
close
<not_specific>
<not_specific>
close Whether to close the path, i.e. return an edge that connects the last point in the vector back to the first point.
close Whether to close the path i . e . return an edge that connects the last point in the vector back to the first point .
see
None