lib/accio/content.rb
def search(text, subtext = nil)
      matches  = []
      snippets = []
      @groups.each do |group|
        if group.title.downcase.include?(text.downcase)
          # Search for matches in the snippets if a subtext is given.
          if subtext
            snippets = snippets | search_snippets(group, subtext)

            # Reallocate the found snippets.
            group.snippets = snippets
          end

          matches << group
        end
      end
      matches
    end
def search(text, subtext = nil)
      matches  = []
      snippets = []
      @groups.each do |group|
        if group.title.downcase.include?(text.downcase)
          # Search for matches in the snippets if a subtext is given.
          if subtext
            snippets = snippets | search_snippets(group, subtext)

            # Reallocate the found snippets.
            group.snippets = snippets
          end

          matches << group
        end
      end
      matches
    end
def search ( text , subtext = nil ) matches = [ ] snippets = [ ] @groups . each do | group | if group . title . downcase . include? ( text . downcase ) # Search for matches in the snippets if a subtext is given. if subtext snippets = snippets | search_snippets ( group , subtext ) # Reallocate the found snippets. group . snippets = snippets end matches << group end end matches end
Public: Constructor.
 Public: Search the groups and snippets for a specific text match.

 text    - The text for main group titles to search for.
 subtext - The subtext for snippet titles to search for.

 Returns Array of Group matches with Snippet matches.
Public : Constructor . Public : Search the groups and snippets for a specific text match .