Module: CanTango::Adaptor::Generic
- Defined in:
- lib/cantango/adaptor/generic.rb
Instance Method Summary collapse
- #adaptor_type ⇒ Object
- #attribute_condition(attribute, candidate) ⇒ Object
- #include_condition(attribute, candidate) ⇒ Object
Instance Method Details
#adaptor_type ⇒ Object
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 |