Class: CloudMade::Line

Inherits:
Geometry show all
Defined in:
lib/geometry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Geometry

parse

Constructor Details

#initialize(coords) ⇒ Line

Returns a new instance of Line.



67
68
69
# File 'lib/geometry.rb', line 67

def initialize(coords)
  @points = coords.map { |latlng| Point.new(latlng) }
end

Instance Attribute Details

#pointsObject

Returns the value of attribute points.



65
66
67
# File 'lib/geometry.rb', line 65

def points
  @points
end

Instance Method Details

#to_sObject



71
72
73
# File 'lib/geometry.rb', line 71

def to_s
  "Line(#{@points.join(',')})"
end