Class: KSFieldExpr

Inherits:
KSExpression show all
Defined in:
lib/kansas/Expression.rb

Instance Method Summary collapse

Methods inherited from KSExpression

binary_function, #count_sql, #delete_sql, operator, #select_sql, unary_function, unary_operator

Constructor Details

#initialize(table, field, context) ⇒ KSFieldExpr

Returns a new instance of KSFieldExpr.



307
308
309
# File 'lib/kansas/Expression.rb', line 307

def initialize(table, field, context)
  @table, @field, @context = table, field, context
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



324
325
326
# File 'lib/kansas/Expression.rb', line 324

def method_missing(method,*args,&block)
  super(method,*args,&block)
end

Instance Method Details

#expr_bodyObject



315
316
317
# File 'lib/kansas/Expression.rb', line 315

def expr_body
  "#{@table.table_name}.#{@field}"
end

#fieldObject



311
312
313
# File 'lib/kansas/Expression.rb', line 311

def field
  @field
end

#old_respond_to?Object



319
# File 'lib/kansas/Expression.rb', line 319

alias :old_respond_to? :respond_to?

#respond_to?(method) ⇒ Boolean

Returns:

  • (Boolean)


320
321
322
# File 'lib/kansas/Expression.rb', line 320

def respond_to?(method)
  old_respond_to?(method)
end