Class: Computron::Report
- Inherits:
-
Object
- Object
- Computron::Report
- Defined in:
- lib/computron/report.rb
Defined Under Namespace
Classes: Request
Instance Attribute Summary collapse
-
#requests ⇒ Object
readonly
Returns the value of attribute requests.
Instance Method Summary collapse
- #by_status ⇒ Object
-
#initialize ⇒ Report
constructor
A new instance of Report.
- #sample(&block) ⇒ Object
Constructor Details
#initialize ⇒ Report
Returns a new instance of Report.
31 32 33 |
# File 'lib/computron/report.rb', line 31 def initialize @requests = [] end |
Instance Attribute Details
#requests ⇒ Object (readonly)
Returns the value of attribute requests.
29 30 31 |
# File 'lib/computron/report.rb', line 29 def requests @requests end |
Instance Method Details
#by_status ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/computron/report.rb', line 35 def by_status requests.inject({}) do |memo, request| memo[request.response.status] ||= [] memo[request.response.status] << request memo end end |