Class: Nosy::Searcher
- Inherits:
-
Object
- Object
- Nosy::Searcher
- Defined in:
- lib/nosy/searcher.rb
Instance Attribute Summary collapse
-
#texts ⇒ Object
Returns the value of attribute texts.
Instance Method Summary collapse
-
#initialize(file) ⇒ Searcher
constructor
A new instance of Searcher.
- #search(filters = {}) ⇒ Object
Constructor Details
Instance Attribute Details
#texts ⇒ Object
Returns the value of attribute texts.
4 5 6 |
# File 'lib/nosy/searcher.rb', line 4 def texts @texts end |
Instance Method Details
#search(filters = {}) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/nosy/searcher.rb', line 10 def search(filters={}) @texts.select do |text| filters.all?{ |key, value| key == :date ? filter_dates(key, value, text) : text[key] == value } end end |