Class: ParamsReady::Helpers::ArelBuilder::Table::Literal
- Defined in:
- lib/params_ready/helpers/arel_builder.rb
Instance Method Summary collapse
-
#initialize(literal, table_alias) ⇒ Literal
constructor
A new instance of Literal.
- #to_arel ⇒ Object
Constructor Details
#initialize(literal, table_alias) ⇒ Literal
Returns a new instance of Literal.
116 117 118 119 120 |
# File 'lib/params_ready/helpers/arel_builder.rb', line 116 def initialize(literal, table_alias) super literal raise "Table alias must be present" if table_alias.nil? @table_alias = table_alias.to_s.freeze end |
Instance Method Details
#to_arel ⇒ Object
122 123 124 |
# File 'lib/params_ready/helpers/arel_builder.rb', line 122 def to_arel(*) Arel::Table.new(@literal).as(@table_alias) end |