Class: Lafcadio::Query::In

Inherits:
Condition show all
Defined in:
lib/lafcadio/query/In.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from Condition

#objectType

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Condition

#dbFieldName, #getField, #initialize, #not, #primaryKeyField?

Constructor Details

This class inherits a constructor from Lafcadio::Query::Condition

Class Method Details

.searchTermTypeObject



6
7
8
# File 'lib/lafcadio/query/In.rb', line 6

def In.searchTermType
	Array
end

Instance Method Details

#objectMeets(anObj) ⇒ Object



14
15
16
17
# File 'lib/lafcadio/query/In.rb', line 14

def objectMeets(anObj)
	value = anObj.send @fieldName
	@searchTerm.index(value) != nil
end

#toSqlObject



10
11
12
# File 'lib/lafcadio/query/In.rb', line 10

def toSql
	"#{ dbFieldName } in (#{ @searchTerm.join(', ') })"
end