Module: CanTango::Adaptor::Generic

Defined in:
lib/cantango/adaptor/generic.rb

Instance Method Summary collapse

Instance Method Details

#adaptor_typeObject



11
12
13
# File 'lib/cantango/adaptor/generic.rb', line 11

def adaptor_type
  :generic
end

#attribute_condition(attribute, candidate) ⇒ Object



3
4
5
# File 'lib/cantango/adaptor/generic.rb', line 3

def attribute_condition attribute, candidate
  Proc.new { |model| model.send(attribute) == candidate }
end

#include_condition(attribute, candidate) ⇒ Object



7
8
9
# File 'lib/cantango/adaptor/generic.rb', line 7

def include_condition attribute, candidate
  Proc.new { |model| model.send(attribute).include? candidate }
end