Class: NoBrainer::Geo::Polygon
- Inherits:
-
Struct
- Object
- Struct
- NoBrainer::Geo::Polygon
- Includes:
- Base
- Defined in:
- lib/no_brainer/geo/polygon.rb
Instance Attribute Summary collapse
-
#points ⇒ Object
Returns the value of attribute points.
Instance Method Summary collapse
-
#initialize(*points) ⇒ Polygon
constructor
A new instance of Polygon.
- #to_rql ⇒ Object
Methods included from Base
Constructor Details
#initialize(*points) ⇒ Polygon
Returns a new instance of Polygon.
4 5 6 |
# File 'lib/no_brainer/geo/polygon.rb', line 4 def initialize(*points) self.points = points.map { |p| NoBrainer::Geo::Point.nobrainer_cast_user_to_model(p) } end |
Instance Attribute Details
#points ⇒ Object
Returns the value of attribute points
1 2 3 |
# File 'lib/no_brainer/geo/polygon.rb', line 1 def points @points end |
Instance Method Details
#to_rql ⇒ Object
8 9 10 |
# File 'lib/no_brainer/geo/polygon.rb', line 8 def to_rql RethinkDB::RQL.new.polygon(points.map(&:to_rql)) end |