Class: Papertrail::SearchResult
- Inherits:
-
Object
- Object
- Papertrail::SearchResult
- Defined in:
- lib/papertrail/search_result.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#events ⇒ Object
readonly
Returns the value of attribute events.
Instance Method Summary collapse
-
#initialize(data) ⇒ SearchResult
constructor
A new instance of SearchResult.
- #max_id ⇒ Object
- #max_time_at ⇒ Object
- #min_id ⇒ Object
- #reached_end? ⇒ Boolean
Constructor Details
#initialize(data) ⇒ SearchResult
Returns a new instance of SearchResult.
7 8 9 10 11 12 13 |
# File 'lib/papertrail/search_result.rb', line 7 def initialize(data) @data = data @events = @data['events'].collect do |event| Papertrail::Event.new(event) end end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/papertrail/search_result.rb', line 5 def data @data end |
#events ⇒ Object (readonly)
Returns the value of attribute events.
5 6 7 |
# File 'lib/papertrail/search_result.rb', line 5 def events @events end |
Instance Method Details
#max_id ⇒ Object
23 24 25 |
# File 'lib/papertrail/search_result.rb', line 23 def max_id @data['max_id'] end |
#max_time_at ⇒ Object
19 20 21 |
# File 'lib/papertrail/search_result.rb', line 19 def max_time_at @max_time_at ||= Time.parse(@data['max_time_at']) end |
#min_id ⇒ Object
27 28 29 |
# File 'lib/papertrail/search_result.rb', line 27 def min_id @data['min_id'] end |
#reached_end? ⇒ Boolean
15 16 17 |
# File 'lib/papertrail/search_result.rb', line 15 def reached_end? @data['reached_end'] end |