Class: Nominatim::Polygon

Inherits:
Object
  • Object
show all
Defined in:
lib/nominatim/polygon.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(coordinates) ⇒ Polygon

Returns a new instance of Polygon

Parameters:

  • coordinates (Array<Array<Float, String>>)

6
7
8
9
10
11
# File 'lib/nominatim/polygon.rb', line 6

def initialize(coordinates)
  @coordinates = []
  coordinates.each do |c|
    @coordinates.push(Nominatim::Point.new(c[0], c[1]))
  end
end

Instance Attribute Details

#coordinatesObject (readonly)

Returns the value of attribute coordinates


3
4
5
# File 'lib/nominatim/polygon.rb', line 3

def coordinates
  @coordinates
end