Class: ActiveRecord::Refined::AST::Column

Inherits:
Node
  • Object
show all
Includes:
Aggregations, Arithmetics, Predications
Defined in:
lib/active_record/refined/ast.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#as, #asc, #desc

Constructor Details

#initialize(table_name, column_name) ⇒ Column

Returns a new instance of Column.



303
304
305
306
# File 'lib/active_record/refined/ast.rb', line 303

def initialize(table_name, column_name)
  @table_name = table_name
  @column_name = column_name
end

Instance Attribute Details

#column_nameObject (readonly)

Returns the value of attribute column_name.



301
302
303
# File 'lib/active_record/refined/ast.rb', line 301

def column_name
  @column_name
end

#table_nameObject (readonly)

Returns the value of attribute table_name.



301
302
303
# File 'lib/active_record/refined/ast.rb', line 301

def table_name
  @table_name
end

Instance Method Details

#to_arel(_table) ⇒ Object



308
309
310
# File 'lib/active_record/refined/ast.rb', line 308

def to_arel(_table)
  Arel::Table.new(table_name)[column_name]
end