Class: Magpie::Search

Inherits:
Object
  • Object
show all
Defined in:
lib/magpie/search.rb

Defined Under Namespace

Classes: SearchResponseError

Constant Summary collapse

URI_BASE =
'http://search.twitter.com/search.atom?q='

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*terms) ⇒ Search

Returns a new instance of Search.



14
15
16
17
18
# File 'lib/magpie/search.rb', line 14

def initialize(*terms)
  @options = terms.last.is_a?(Hash) ? terms.pop : {}
  xml      = xml_search_result_for(terms)
  @results = Tweet.map_from_xml(xml)
end

Instance Attribute Details

#resultsObject (readonly)

Returns the value of attribute results.



12
13
14
# File 'lib/magpie/search.rb', line 12

def results
  @results
end

#uriObject (readonly)

Returns the value of attribute uri.



12
13
14
# File 'lib/magpie/search.rb', line 12

def uri
  @uri
end

Instance Method Details

#inspectObject



20
21
22
# File 'lib/magpie/search.rb', line 20

def inspect
  "#<#{self.class}:#{object_id}>"
end