Class: Sherlog::Result
- Inherits:
-
Object
- Object
- Sherlog::Result
- Defined in:
- lib/sherlog_holmes/result.rb
Instance Method Summary collapse
- #<<(entry) ⇒ Object
- #entries(params = {}) ⇒ Object
- #exceptions ⇒ Object
-
#initialize ⇒ Result
constructor
A new instance of Result.
- #size ⇒ Object
Constructor Details
#initialize ⇒ Result
Returns a new instance of Result.
26 27 28 |
# File 'lib/sherlog_holmes/result.rb', line 26 def initialize @entries = [] end |
Instance Method Details
#<<(entry) ⇒ Object
30 31 32 33 |
# File 'lib/sherlog_holmes/result.rb', line 30 def <<(entry) @entries << entry self end |
#entries(params = {}) ⇒ Object
35 36 37 38 |
# File 'lib/sherlog_holmes/result.rb', line 35 def entries(params = {}) return @entries.find_all { |entry| params[:filter].accept? entry } if params[:filter] @entries end |
#exceptions ⇒ Object
40 41 42 |
# File 'lib/sherlog_holmes/result.rb', line 40 def exceptions entries filter: Filter::exceptions end |
#size ⇒ Object
44 45 46 |
# File 'lib/sherlog_holmes/result.rb', line 44 def size @entries.size end |