Module: Searchable Private

Included in:
Cask::Cask, DescriptionCacheStore
Defined in:
searchable.rb

Overview

This module is part of a private API. This module may only be used in the Homebrew/brew repository. Third parties should avoid using this module if possible, as it may be removed or changed without warning.

Helper module for making a class searchable with both regular expressions and strings.

Instance Method Summary collapse

Instance Method Details

#search(string_or_regex, &block) ⇒ Object

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.



8
9
10
11
12
13
14
15
# File 'searchable.rb', line 8

def search(string_or_regex, &block)
  case string_or_regex
  when Regexp
    search_regex(string_or_regex, &block)
  else
    search_string(string_or_regex.to_str, &block)
  end
end