Module: Togglapper::Searches::Tag
Instance Method Summary
collapse
Methods included from Base
#entries, #entry_info, #entry_info_string, #get_diff_time_by_entry, #latest_entry, #working_entry
Instance Method Details
7
8
9
|
# File 'lib/togglapper/searches/tag.rb', line 7
def entries_by_tags(*tags)
entries_by_tags_for(self.entries, tags)
end
|
11
12
13
14
15
16
17
|
# File 'lib/togglapper/searches/tag.rb', line 11
def entries_by_tags_for(entries, *tags)
entries.select do |entry|
tags.flatten.map(&:to_s).all? do |tag|
entry["tags"] && entry["tags"].include?(tag)
end
end
end
|