Class: Identifier

Inherits:
Expression show all
Defined in:
lib/eno/expressions.rb

Constant Summary

Constants inherited from Expression

Expression::S_AND, Expression::S_DIV, Expression::S_EQ, Expression::S_GT, Expression::S_GTE, Expression::S_LT, Expression::S_LTE, Expression::S_MINUS, Expression::S_MOD, Expression::S_MUL, Expression::S_NEQ, Expression::S_OR, Expression::S_PLUS, Expression::S_TILDE

Instance Attribute Summary

Attributes inherited from Expression

#members, #props

Instance Method Summary collapse

Methods inherited from Expression

#!=, #!@, #%, #&, #*, #+, #-, #/, #<, #<=, #==, #=~, #>, #>=, #^, #as, #cast, #desc, #in, #initialize, #inner_join, #join, #not_in, #not_null?, #null?, #over, #|

Constructor Details

This class inherits a constructor from Expression

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym) ⇒ Object



250
251
252
253
# File 'lib/eno/expressions.rb', line 250

def method_missing(sym)
  super if sym == :to_hash
  Identifier.new("#{@members[0]}.#{sym}")
end

Instance Method Details

#_empty_placeholder?Boolean

Returns:

  • (Boolean)


255
256
257
258
# File 'lib/eno/expressions.rb', line 255

def _empty_placeholder?
  m = @members[0]
  Symbol === m && m == :_
end

#to_sql(sql) ⇒ Object



246
247
248
# File 'lib/eno/expressions.rb', line 246

def to_sql(sql)
  sql.quote(@members[0].to_sym)
end