Class: Magpie::Search
- Inherits:
-
Object
- Object
- Magpie::Search
- 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
-
#results ⇒ Object
readonly
Returns the value of attribute results.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(*terms) ⇒ Search
constructor
A new instance of Search.
- #inspect ⇒ Object
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
#results ⇒ Object (readonly)
Returns the value of attribute results.
12 13 14 |
# File 'lib/magpie/search.rb', line 12 def results @results end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
12 13 14 |
# File 'lib/magpie/search.rb', line 12 def uri @uri end |
Instance Method Details
#inspect ⇒ Object
20 21 22 |
# File 'lib/magpie/search.rb', line 20 def inspect "#<#{self.class}:#{object_id}>" end |