Sha256: db77fac4ed104a4dcd1379ce431e6db0d08afcfa6be2229ce38bd251305cf1bb

Contents?: true

Size: 381 Bytes

Versions: 71

Compression:

Stored size: 381 Bytes

Contents

class SnippetFinder
  class << self
    def find(id)
      find_map('find', id)
    end

    def find_by_name(name)
      find_map('find_by_name', name)
    end

    def finder_types
      [Snippet]
    end

    private

    def find_map(meth, *args)
      finder_types.find do |type|
        found = type.send(meth, *args)
        return found if found
      end
    end
  end
end

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
trusty-cms-6.3.1 app/models/snippet_finder.rb
trusty-cms-7.0.2 app/models/snippet_finder.rb
trusty-cms-7.0.1 app/models/snippet_finder.rb
trusty-cms-7.0.0 app/models/snippet_finder.rb
trusty-cms-6.3 app/models/snippet_finder.rb
trusty-cms-6.2.1 app/models/snippet_finder.rb
trusty-cms-6.2.2.1 app/models/snippet_finder.rb
trusty-cms-6.2.0 app/models/snippet_finder.rb
trusty-cms-6.1.2 app/models/snippet_finder.rb
trusty-cms-6.1.1 app/models/snippet_finder.rb
trusty-cms-6.0.5 app/models/snippet_finder.rb
trusty-cms-6.0.4 app/models/snippet_finder.rb
trusty-cms-6.0.3 app/models/snippet_finder.rb
trusty-cms-6.0.2 app/models/snippet_finder.rb
trusty-cms-6.0.1 app/models/snippet_finder.rb
trusty-cms-5.6.1 app/models/snippet_finder.rb
trusty-cms-6.0.0 app/models/snippet_finder.rb
trusty-cms-5.6.0 app/models/snippet_finder.rb
trusty-cms-5.5.9 app/models/snippet_finder.rb
trusty-cms-5.5.8 app/models/snippet_finder.rb