Class: RGeo::ActiveRecord::SpatialNamedFunction
- Inherits:
-
Arel::Nodes::NamedFunction
- Object
- Arel::Nodes::NamedFunction
- RGeo::ActiveRecord::SpatialNamedFunction
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
#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
100
101
102
103
104
105
106
107
108
|
# File 'lib/rgeo/active_record/arel_spatial_queries.rb', line 100
def initialize(name, expr, spatial_flags = [], aliaz = nil)
if Arel::Nodes::NamedFunction.instance_method(:initialize).parameters.size == 2
super(name, expr)
@aliaz = aliaz
else
super(name, expr, aliaz)
end
@spatial_flags = spatial_flags
end
|
Instance Method Details
#alias ⇒ Object
118
119
120
|
# File 'lib/rgeo/active_record/arel_spatial_queries.rb', line 118
def alias
@aliaz || (instance_variable_defined?(:@alias) ? @alias : nil)
end
|
#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
|