Class: ActiveRecord::Refined::AST::Value
- Includes:
- Aggregations, Arithmetics, Predications
- Defined in:
- lib/active_record/refined/ast.rb
Overview
A literal standing where an expression would: select { value(0).as(:depth) }.
Values reach the SQL quoted wherever they appear as an operand, but the
top of a select list is ActiveRecord's, and a bare string there is SQL
rather than a string. Saying value is how you ask for the other
meaning, and it carries the predications with it, so a literal can be
compared and combined like anything else.
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value) ⇒ Value
constructor
A new instance of Value.
- #to_arel(_table) ⇒ Object
Methods included from Aggregations
#average, #count, #maximum, #minimum, #sum
Methods included from Arithmetics
Methods included from Predications
#!=, #!~, #<, #<=, #==, #=~, #>, #>=, #between?, #casecmp?, #distinct_from?, #end_with?, #ilike?, #in?, #include?, #intersect?, #like?, #member?, #not_between?, #not_distinct_from?, #not_ilike?, #not_in?, #not_like?, #not_null?, #null?, #start_with?, #subset?, #superset?
Methods inherited from Node
Constructor Details
#initialize(value) ⇒ Value
Returns a new instance of Value.
287 288 289 |
# File 'lib/active_record/refined/ast.rb', line 287 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
285 286 287 |
# File 'lib/active_record/refined/ast.rb', line 285 def value @value end |
Instance Method Details
#to_arel(_table) ⇒ Object
291 292 293 |
# File 'lib/active_record/refined/ast.rb', line 291 def to_arel(_table) Arel::Nodes.build_quoted(value) end |