# File lib/scruffy/helpers/point_container.rb, line 69 def each_point(&block) if is_coordinate_list? each{|x,y|block.call(x,y)} else size.times{|k|block.call(k,self[k])} end end
# File lib/scruffy/helpers/point_container.rb, line 62 def is_coordinate_list? if any? && first.is_a?(Array) && first.size == 2 return true end return false end
# File lib/scruffy/helpers/point_container.rb, line 57 def keys return [0,size-1] unless is_coordinate_list? collect { |x,y| x} end
# File lib/scruffy/helpers/point_container.rb, line 52 def values return self unless is_coordinate_list? collect { |x,y| y} end