Class: Lafcadio::Query::In

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

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from Condition

#domain_class

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Condition

#&, #db_field_name, #eql?, #field, #implies?, #initialize, #not, #one_pk_id?, #primary_key_field?, #query, #to_condition, #|

Constructor Details

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

Class Method Details

.search_term_typeObject



567
# File 'lib/lafcadio/query.rb', line 567

def self.search_term_type; Array; end

Instance Method Details

#dobj_satisfies?(anObj) ⇒ Boolean

Returns:

  • (Boolean)


569
570
571
# File 'lib/lafcadio/query.rb', line 569

def dobj_satisfies?(anObj)
	@searchTerm.include?( anObj.send( @fieldName ) )
end

#to_sqlObject



573
574
575
576
577
578
579
580
581
# File 'lib/lafcadio/query.rb', line 573

def to_sql
	if field.is_a?( StringField )
		quoted = @searchTerm.map do |str| "'#{ str }'"; end
		end_clause = quoted.join ', '
	else
		end_clause = @searchTerm.join ', '
	end
	"#{ db_field_name } in (#{ end_clause })"
end