Class: ActiveRecord::Refined::AST::Value
- Includes:
- 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, _model) ⇒ Object
Methods included from Arithmetics
#&, #*, #+, #-, #/, #<<, #>>, #^, #|, #~
Methods included from Predications
#!=, #!~, #<, #<=, #==, #=~, #>, #>=, #between?, #bury, #casecmp?, #contains?, #dig, #dig_json, #distinct_from?, #end_with?, #false?, #ilike?, #in?, #include?, #intersect?, #key?, #like?, #member?, #not_between?, #not_distinct_from?, #not_false?, #not_ilike?, #not_in?, #not_like?, #not_null?, #not_true?, #null?, #start_with?, #subset?, #superset?, #true?, #when
Methods inherited from Node
Constructor Details
#initialize(value) ⇒ Value
Returns a new instance of Value.
368 369 370 |
# File 'lib/active_record/refined/ast.rb', line 368 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
366 367 368 |
# File 'lib/active_record/refined/ast.rb', line 366 def value @value end |
Instance Method Details
#to_arel(_table, _model) ⇒ Object
372 373 374 |
# File 'lib/active_record/refined/ast.rb', line 372 def to_arel(_table, _model) Arel::Nodes.build_quoted(value) end |