Class: ActiveRecord::Refined::AST::Column
- Defined in:
- lib/active_record/refined/ast.rb
Instance Attribute Summary collapse
-
#column_name ⇒ Object
readonly
Returns the value of attribute column_name.
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Instance Method Summary collapse
-
#initialize(table_name, column_name) ⇒ Column
constructor
A new instance of Column.
- #null? ⇒ Boolean
- #to_arel(_table) ⇒ Object
Methods inherited from Node
Constructor Details
#initialize(table_name, column_name) ⇒ Column
Returns a new instance of Column.
39 40 41 42 |
# File 'lib/active_record/refined/ast.rb', line 39 def initialize(table_name, column_name) @table_name = table_name @column_name = column_name end |
Instance Attribute Details
#column_name ⇒ Object (readonly)
Returns the value of attribute column_name.
37 38 39 |
# File 'lib/active_record/refined/ast.rb', line 37 def column_name @column_name end |
#table_name ⇒ Object (readonly)
Returns the value of attribute table_name.
37 38 39 |
# File 'lib/active_record/refined/ast.rb', line 37 def table_name @table_name end |
Instance Method Details
#null? ⇒ Boolean
52 53 54 |
# File 'lib/active_record/refined/ast.rb', line 52 def null? Comparison.new(self, :==, nil) end |
#to_arel(_table) ⇒ Object
44 45 46 |
# File 'lib/active_record/refined/ast.rb', line 44 def to_arel(_table) Arel::Table.new(table_name)[column_name] end |