Class: RGeo::ActiveRecord::SpatialNamedFunction

Inherits:
Arel::Nodes::NamedFunction
  • Object
show all
Includes:
SpatialExpressions
Defined in:
lib/rgeo/active_record/arel_spatial_queries.rb

Overview

A NamedFunction subclass that keeps track of the spatial-ness of the arguments and return values, so that it can provide context to visitors that want to interpret syntax differently when dealing with spatial elements.

Instance Method Summary collapse

Methods included from SpatialExpressions

#st_area, #st_asbinary, #st_astext, #st_boundary, #st_buffer, #st_centroid, #st_contains, #st_convexhull, #st_crosses, #st_difference, #st_dimension, #st_disjoint, #st_distance, #st_endpoint, #st_envelope, #st_equals, #st_exteriorring, #st_function, #st_geometryn, #st_geometrytype, #st_interiorringn, #st_intersection, #st_intersects, #st_isclosed, #st_isempty, #st_isring, #st_issimple, #st_length, #st_m, #st_numgeometries, #st_numinteriorrings, #st_numpoints, #st_overlaps, #st_pointn, #st_pointonsurface, #st_relate, #st_srid, #st_startpoint, #st_symdifference, #st_touches, #st_union, #st_within, #st_x, #st_y, #st_z

Constructor Details

#initialize(name, expr, spatial_flags = [], aliaz = nil) ⇒ SpatialNamedFunction


105
106
107
108
# File 'lib/rgeo/active_record/arel_spatial_queries.rb', line 105

def initialize(name, expr, spatial_flags = [], aliaz = nil)
  super(name, expr, aliaz)
  @spatial_flags = spatial_flags
end

Instance Method Details

#spatial_argument?(index) ⇒ Boolean


114
115
116
# File 'lib/rgeo/active_record/arel_spatial_queries.rb', line 114

def spatial_argument?(index)
  @spatial_flags[index + 1]
end

#spatial_result?Boolean


110
111
112
# File 'lib/rgeo/active_record/arel_spatial_queries.rb', line 110

def spatial_result?
  @spatial_flags.first
end