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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#as, #asc, #desc

Constructor Details

#initialize(table_name, column_name) ⇒ Column

Returns a new instance of Column.



689
690
691
692
# File 'lib/active_record/refined/ast.rb', line 689

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.



687
688
689
# File 'lib/active_record/refined/ast.rb', line 687

def column_name
  @column_name
end

#table_nameObject (readonly)

Returns the value of attribute table_name.



687
688
689
# File 'lib/active_record/refined/ast.rb', line 687

def table_name
  @table_name
end

Instance Method Details

#to_arel(_table, _model) ⇒ Object



694
695
696
# File 'lib/active_record/refined/ast.rb', line 694

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