Class: SmqlToAR::ConditionTypes::Functions::Function

Inherits:
Object
  • Object
show all
Includes:
Assertion
Defined in:
lib/smql_to_ar/condition_types.rb

Direct Known Subclasses

Limit, Offset, Order

Constant Summary collapse

Name =
nil
Expected =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Assertion

#raise_if, #raise_unless

Constructor Details

#initialize(model, func, args) ⇒ Function

Returns a new instance of Function.



418
419
420
# File 'lib/smql_to_ar/condition_types.rb', line 418

def initialize model, func, args
	@model, @func, @args = model, func, args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



406
407
408
# File 'lib/smql_to_ar/condition_types.rb', line 406

def args
  @args
end

#funcObject (readonly)

Returns the value of attribute func.



406
407
408
# File 'lib/smql_to_ar/condition_types.rb', line 406

def func
  @func
end

#modelObject (readonly)

Returns the value of attribute model.



406
407
408
# File 'lib/smql_to_ar/condition_types.rb', line 406

def model
  @model
end

Class Method Details

.inspectObject



413
414
415
# File 'lib/smql_to_ar/condition_types.rb', line 413

def inspect
	"#{self.name}( :name=>#{self::Name}, :expected=>#{self::Expected})"
end

.try_parse(model, func, args) ⇒ Object



409
410
411
# File 'lib/smql_to_ar/condition_types.rb', line 409

def try_parse model, func, args
	self.new model, func, args  if self::Name === func and self::Expected.any? {|x| x === args }
end