Class: NoBrainer::Geo::LineString

Inherits:
Struct
  • Object
show all
Includes:
Base
Defined in:
lib/no_brainer/geo/line_string.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Base

normalize_geo_options

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

#pointsObject

Returns the value of attribute points

Returns:

  • (Object)

    the current value of points



1
2
3
# File 'lib/no_brainer/geo/line_string.rb', line 1

def points
  @points
end

Instance Method Details

#to_rqlObject



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