Class: NoBrainer::Geo::LineString
- Inherits:
-
Struct
- Object
- Struct
- NoBrainer::Geo::LineString
- Includes:
- Base
- Defined in:
- lib/no_brainer/geo/line_string.rb
Instance Attribute Summary collapse
-
#points ⇒ Object
Returns the value of attribute points.
Instance Method Summary collapse
-
#initialize(*points) ⇒ LineString
constructor
A new instance of LineString.
- #to_rql ⇒ Object
Methods included from Base
Constructor Details
#initialize(*points) ⇒ LineString
Returns a new instance of LineString.
4 5 6 |
# File 'lib/no_brainer/geo/line_string.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/line_string.rb', line 1 def points @points end |
Instance Method Details
#to_rql ⇒ Object
8 9 10 |
# File 'lib/no_brainer/geo/line_string.rb', line 8 def to_rql RethinkDB::RQL.new.line(points.map(&:to_rql)) end |