Class: ParamsReady::Helpers::ArelBuilder::Literal

Inherits:
Object
  • Object
show all
Defined in:
lib/params_ready/helpers/arel_builder.rb

Direct Known Subclasses

Attribute::Literal, Table::Literal

Instance Method Summary collapse

Constructor Details

#initialize(literal) ⇒ Literal

Returns a new instance of Literal.



41
42
43
# File 'lib/params_ready/helpers/arel_builder.rb', line 41

def initialize(literal)
  @literal = literal.to_s.freeze
end

Instance Method Details

#to_arelObject



45
46
47
# File 'lib/params_ready/helpers/arel_builder.rb', line 45

def to_arel(*)
  Arel::Nodes::SqlLiteral.new(@literal)
end