Class: Squeel::Nodes::Function
- Inherits:
-
Object
- Object
- Squeel::Nodes::Function
- Includes:
- Operators, PredicateMethods
- Defined in:
- lib/squeel/nodes/function.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#alias ⇒ Object
readonly
Returns the value of attribute alias.
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #<(value) ⇒ Object
- #<<(value) ⇒ Object
- #<=(value) ⇒ Object
- #==(value) ⇒ Object
- #=~(value) ⇒ Object
- #>(value) ⇒ Object
- #>=(value) ⇒ Object
- #>>(value) ⇒ Object
- #^(value) ⇒ Object
- #as(alias_name) ⇒ Object
- #asc ⇒ Object
- #desc ⇒ Object
-
#initialize(name, args) ⇒ Function
constructor
A new instance of Function.
-
#to_sym ⇒ Object
expand_hash_conditions_for_aggregates assumes our hash keys can be converted to symbols, so this has to be implemented, but it doesn’t really have to do anything useful.
Methods included from Operators
Methods included from PredicateMethods
Constructor Details
#initialize(name, args) ⇒ Function
Returns a new instance of Function.
12 13 14 |
# File 'lib/squeel/nodes/function.rb', line 12 def initialize(name, args) @name, @args = name, args end |
Instance Attribute Details
#alias ⇒ Object (readonly)
Returns the value of attribute alias.
10 11 12 |
# File 'lib/squeel/nodes/function.rb', line 10 def alias @alias end |
#args ⇒ Object (readonly)
Returns the value of attribute args.
10 11 12 |
# File 'lib/squeel/nodes/function.rb', line 10 def args @args end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/squeel/nodes/function.rb', line 10 def name @name end |
Instance Method Details
#<(value) ⇒ Object
67 68 69 |
# File 'lib/squeel/nodes/function.rb', line 67 def <(value) Predicate.new self, :lt, value end |
#<<(value) ⇒ Object
46 47 48 |
# File 'lib/squeel/nodes/function.rb', line 46 def <<(value) Predicate.new self, :not_in, value end |
#<=(value) ⇒ Object
71 72 73 |
# File 'lib/squeel/nodes/function.rb', line 71 def <=(value) Predicate.new self, :lteq, value end |
#==(value) ⇒ Object
21 22 23 |
# File 'lib/squeel/nodes/function.rb', line 21 def ==(value) Predicate.new self, :eq, value end |
#=~(value) ⇒ Object
50 51 52 |
# File 'lib/squeel/nodes/function.rb', line 50 def =~(value) Predicate.new self, :matches, value end |
#>(value) ⇒ Object
59 60 61 |
# File 'lib/squeel/nodes/function.rb', line 59 def >(value) Predicate.new self, :gt, value end |
#>=(value) ⇒ Object
63 64 65 |
# File 'lib/squeel/nodes/function.rb', line 63 def >=(value) Predicate.new self, :gteq, value end |
#>>(value) ⇒ Object
42 43 44 |
# File 'lib/squeel/nodes/function.rb', line 42 def >>(value) Predicate.new self, :in, value end |
#^(value) ⇒ Object
38 39 40 |
# File 'lib/squeel/nodes/function.rb', line 38 def ^(value) Predicate.new self, :not_eq, value end |
#as(alias_name) ⇒ Object
16 17 18 19 |
# File 'lib/squeel/nodes/function.rb', line 16 def as(alias_name) @alias = alias_name.to_s self end |
#desc ⇒ Object
29 30 31 |
# File 'lib/squeel/nodes/function.rb', line 29 def desc Order.new self, -1 end |
#to_sym ⇒ Object
expand_hash_conditions_for_aggregates assumes our hash keys can be converted to symbols, so this has to be implemented, but it doesn’t really have to do anything useful.
78 79 80 |
# File 'lib/squeel/nodes/function.rb', line 78 def to_sym nil end |