Class: Twingly::Analytics::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/twingly-analytics/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#number_of_matches_returnedObject

Returns the value of attribute number_of_matches_returned.



4
5
6
# File 'lib/twingly-analytics/result.rb', line 4

def number_of_matches_returned
  @number_of_matches_returned
end

#number_of_matches_totalObject

Returns the value of attribute number_of_matches_total.



4
5
6
# File 'lib/twingly-analytics/result.rb', line 4

def number_of_matches_total
  @number_of_matches_total
end

#seconds_elapsedObject

Returns the value of attribute seconds_elapsed.



4
5
6
# File 'lib/twingly-analytics/result.rb', line 4

def seconds_elapsed
  @seconds_elapsed
end

Instance Method Details

#all_results_returned?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/twingly-analytics/result.rb', line 11

def all_results_returned?
  number_of_matches_returned.to_i == number_of_matches_total.to_i
end

#inspectObject



15
16
17
18
19
20
21
# File 'lib/twingly-analytics/result.rb', line 15

def inspect
  matches = "@posts, "
  matches << "@number_of_matches_returned=#{self.number_of_matches_returned}, "
  matches << "@number_of_matches_total=#{self.number_of_matches_total}"

  sprintf("#<%s:0x%x %s>", self.class.name, __id__, matches)
end

#postsObject



7
8
9
# File 'lib/twingly-analytics/result.rb', line 7

def posts
  @posts ||= []
end