Module: Sunspot::Query::Restriction

Defined in:
sunspot/lib/sunspot/query/restriction.rb

Overview

:nodoc:

Defined Under Namespace

Classes: AllOf, AnyOf, Base, Between, EqualTo, GreaterThan, LessThan, StartingWith

Class Method Summary (collapse)

Class Method Details

+ (Object) [](restriction_name)

Convenience method to access a restriction class by an underscored symbol or string



21
22
23
24
# File 'sunspot/lib/sunspot/query/restriction.rb', line 21

def [](restriction_name)
  @types ||= {}
  @types[restriction_name.to_sym] ||= const_get(Sunspot::Util.camel_case(restriction_name.to_s))
end

+ (Object) names

Return the names of all of the restriction classes that should be made available to the DSL.

Returns

Array

Collection of restriction class names



13
14
15
# File 'sunspot/lib/sunspot/query/restriction.rb', line 13

def names
  constants - %w(Base) #XXX this seems ugly
end