Sha256: 1d01d8bd5ed08701ff87495aa98ddae7d9027723c57532690f553042740f4b30

Contents?: true

Size: 375 Bytes

Versions: 58

Compression:

Stored size: 375 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{|type|
        found = type.send(meth, *args)
        return found if found
      }
    end
  end
end

Version data entries

58 entries across 58 versions & 2 rubygems

Version Path
trusty-cms-4.1.2 app/models/snippet_finder.rb
trusty-cms-4.1.1 app/models/snippet_finder.rb
trusty-cms-4.1.0 app/models/snippet_finder.rb
trusty-cms-4.0.2 app/models/snippet_finder.rb
trusty-cms-3.9.7 app/models/snippet_finder.rb
trusty-cms-3.9.6 app/models/snippet_finder.rb
trusty-cms-3.9.5 app/models/snippet_finder.rb
trusty-cms-4.0.1 app/models/snippet_finder.rb
trusty-cms-3.9.4 app/models/snippet_finder.rb
trusty-cms-3.9.3 app/models/snippet_finder.rb
trusty-cms-3.9.2 app/models/snippet_finder.rb
trusty-cms-4.0.0 app/models/snippet_finder.rb
trusty-cms-3.9.1 app/models/snippet_finder.rb
trusty-cms-3.9.0 app/models/snippet_finder.rb
trusty-cms-3.8.4 app/models/snippet_finder.rb
trusty-cms-3.8.3 app/models/snippet_finder.rb
trusty-cms-3.8.2 app/models/snippet_finder.rb
trusty-cms-3.8.1 app/models/snippet_finder.rb
trusty-cms-3.8.0 app/models/snippet_finder.rb
trusty-cms-3.7.1 app/models/snippet_finder.rb