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_text, #distinct_from?, #end_with?, #except, #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.



824
825
826
827
# File 'lib/active_record/refined/ast.rb', line 824

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.



822
823
824
# File 'lib/active_record/refined/ast.rb', line 822

def column_name
  @column_name
end

#table_nameObject (readonly)

Returns the value of attribute table_name.



822
823
824
# File 'lib/active_record/refined/ast.rb', line 822

def table_name
  @table_name
end

Instance Method Details

#to_arel(_table, _model) ⇒ Object



829
830
831
# File 'lib/active_record/refined/ast.rb', line 829

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