Sha256: 03e49668dc1f3ffe9544d69fc92a894be54b5d257cbd15daeafc503efdda3141

Contents?: true

Size: 296 Bytes

Versions: 9

Compression:

Stored size: 296 Bytes

Contents

module CanTango::Adaptor
  module Generic

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

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
cantango-core-0.1.9.2 lib/cantango/adaptor/generic.rb
cantango-core-0.1.9.1 lib/cantango/adaptor/generic.rb
cantango-core-0.1.9 lib/cantango/adaptor/generic.rb
cantango-core-0.1.8 lib/cantango/adaptor/generic.rb
cantango-core-0.1.7 lib/cantango/adaptor/generic.rb
cantango-core-0.1.6 lib/cantango/adaptor/generic.rb
cantango-core-0.1.5 lib/cantango/adaptor/generic.rb
cantango-core-0.1.4 lib/cantango/adaptor/generic.rb
cantango-core-0.1.3 lib/cantango/adaptor/generic.rb