Class: Twingly::Search::Result
- Inherits:
-
Object
- Object
- Twingly::Search::Result
- Defined in:
- lib/twingly/search/result.rb
Overview
Represents a result from a Query to the Search API
Instance Attribute Summary collapse
-
#incomplete_result ⇒ Object
writeonly
Sets the attribute incomplete_result.
- #number_of_matches_returned ⇒ Integer
- #number_of_matches_total ⇒ Integer
-
#seconds_elapsed ⇒ Integer
number of seconds it took to execute the Query.
Instance Method Summary collapse
- #all_results_returned? ⇒ true, false
- #incomplete? ⇒ true, false
- #inspect ⇒ Object
-
#posts ⇒ Array<Post>
All posts that matched the Query.
Instance Attribute Details
#incomplete_result=(value) ⇒ Object (writeonly)
Sets the attribute incomplete_result
17 18 19 |
# File 'lib/twingly/search/result.rb', line 17 def incomplete_result=(value) @incomplete_result = value end |
#number_of_matches_returned ⇒ Integer
14 15 16 |
# File 'lib/twingly/search/result.rb', line 14 def number_of_matches_returned @number_of_matches_returned end |
#number_of_matches_total ⇒ Integer
14 15 16 |
# File 'lib/twingly/search/result.rb', line 14 def number_of_matches_total @number_of_matches_total end |
#seconds_elapsed ⇒ Integer
number of seconds it took to execute the Query.
14 15 16 |
# File 'lib/twingly/search/result.rb', line 14 def seconds_elapsed @seconds_elapsed end |
Instance Method Details
#all_results_returned? ⇒ true, false
35 36 37 |
# File 'lib/twingly/search/result.rb', line 35 def all_results_returned? number_of_matches_returned.to_i == number_of_matches_total.to_i end |
#incomplete? ⇒ true, false
24 25 26 |
# File 'lib/twingly/search/result.rb', line 24 def incomplete? @incomplete_result end |
#inspect ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/twingly/search/result.rb', line 39 def inspect instance_methods = [ "posts", "number_of_matches_returned=#{self.number_of_matches_returned}", "number_of_matches_total=#{self.number_of_matches_total}", "seconds_elapsed=#{self.seconds_elapsed}", "all_results_returned?=#{self.all_results_returned?}", "incomplete?=#{self.incomplete?}", ].join(", ") sprintf("#<%s:0x%x %s>", self.class.name, __id__, instance_methods) end |