Class: Twingly::LiveFeed::Result
- Inherits:
-
Object
- Object
- Twingly::LiveFeed::Result
- Defined in:
- lib/twingly/livefeed/result.rb
Overview
Represents a result from a request to the LiveFeed API
Instance Attribute Summary collapse
-
#first_post ⇒ Time
the index time for the first post in the result.
-
#from ⇒ Time
the timestamp that was sent in the request.
-
#last_post ⇒ Time
the index time for the last post in the result.
-
#max_number_of_posts ⇒ Integer
the maximum number of posts this result could contain.
-
#next_timestamp ⇒ Time
the timestamp that should be used to get the next batch of posts.
-
#number_of_posts ⇒ Integer
the number of posts this result contains.
-
#ts ⇒ Time
the exact time when the result was built.
Instance Method Summary collapse
- #inspect ⇒ Object
-
#posts ⇒ Array<Post>
All posts that matched the Query.
Instance Attribute Details
#first_post ⇒ Time
the index time for the first post in the result
18 19 20 |
# File 'lib/twingly/livefeed/result.rb', line 18 def first_post @first_post end |
#from ⇒ Time
the timestamp that was sent in the request. See Client#timestamp
18 19 20 |
# File 'lib/twingly/livefeed/result.rb', line 18 def from @from end |
#last_post ⇒ Time
the index time for the last post in the result
18 19 20 |
# File 'lib/twingly/livefeed/result.rb', line 18 def last_post @last_post end |
#max_number_of_posts ⇒ Integer
the maximum number of posts this result could contain. See Client#max_posts
18 19 20 |
# File 'lib/twingly/livefeed/result.rb', line 18 def max_number_of_posts @max_number_of_posts end |
#next_timestamp ⇒ Time
the timestamp that should be used to get the next batch of posts
18 19 20 |
# File 'lib/twingly/livefeed/result.rb', line 18 def @next_timestamp end |
#number_of_posts ⇒ Integer
the number of posts this result contains
18 19 20 |
# File 'lib/twingly/livefeed/result.rb', line 18 def number_of_posts @number_of_posts end |
#ts ⇒ Time
the exact time when the result was built
18 19 20 |
# File 'lib/twingly/livefeed/result.rb', line 18 def ts @ts end |
Instance Method Details
#inspect ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/twingly/livefeed/result.rb', line 27 def inspect instance_methods = [ "posts", "ts=#{self.ts}", "from=#{self.from}", "number_of_posts=#{self.number_of_posts}", "max_number_of_posts=#{self.max_number_of_posts}", "first_post=#{self.first_post}", "last_post=#{self.last_post}", "next_timestamp=#{self.}", ].join(", ") sprintf("#<%s:0x%x %s>", self.class.name, __id__, instance_methods) end |
#posts ⇒ Array<Post>
Returns all posts that matched the Query.
23 24 25 |
# File 'lib/twingly/livefeed/result.rb', line 23 def posts @posts ||= [] end |