Class: Teleportd::SearchResult
- Inherits:
-
Object
- Object
- Teleportd::SearchResult
- Defined in:
- lib/teleportd/search_result.rb
Overview
Represents an individual image returned from a Search call
Direct Known Subclasses
Instance Attribute Summary collapse
- #result_hash ⇒ Object readonly private
Instance Method Summary collapse
-
#date ⇒ Fixnum
Returns the result’s time as seconds from the epoch.
-
#full_resolution_url ⇒ String
Returns the full resolution image url for the result.
-
#hashtags ⇒ Array
Returns the hashtags of the search result in an Array NOTE: Will return nil unless you have an enterprise account.
-
#initialize(result_hash = {}) ⇒ Teleportd::SearchResult
constructor
Accepts a hash from a Teleportd::Search and returns an instance of Teleportd::SearchResult.
-
#location ⇒ Hash
Returns a Hash with the results latitude and longitude values.
-
#mentions ⇒ Array
Returns the mentions of the search result in an Array NOTE: Will return nil unless you have an enterprise account.
-
#profile_pic_url ⇒ String
Returns the user’s profile pic url from the respective service account NOTE: Will return nil unless you have an enterprise account.
-
#sha ⇒ String
Returns a String representing the search result SHA hash.
-
#source ⇒ String
Returns the source of the result (“twimg”, “instagram”, etc.).
-
#text ⇒ Array
Returns the comments or title of the search result in an Array NOTE: Will return nil unless you have an enterprise account.
-
#thumbnail_url ⇒ String
Returns the thumbnail image url for the result.
-
#type ⇒ String
Returns a String representing the search result type (usually “image”).
-
#users ⇒ Array
Returns the author handles identified from the result NOTE: Will return nil unless you have an enterprise account.
Constructor Details
#initialize(result_hash = {}) ⇒ Teleportd::SearchResult
Accepts a hash from a Teleportd::Search and returns an instance of Teleportd::SearchResult
16 17 18 |
# File 'lib/teleportd/search_result.rb', line 16 def initialize result_hash={} @result_hash = result_hash end |
Instance Attribute Details
#result_hash ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
6 7 8 |
# File 'lib/teleportd/search_result.rb', line 6 def result_hash @result_hash end |
Instance Method Details
#date ⇒ Fixnum
Returns the result’s time as seconds from the epoch
44 45 46 |
# File 'lib/teleportd/search_result.rb', line 44 def date result_hash['dte'] end |
#full_resolution_url ⇒ String
Returns the full resolution image url for the result
65 66 67 |
# File 'lib/teleportd/search_result.rb', line 65 def full_resolution_url result_hash['fll'] end |
#hashtags ⇒ Array
Returns the hashtags of the search result in an Array NOTE: Will return nil unless you have an enterprise account
97 98 99 |
# File 'lib/teleportd/search_result.rb', line 97 def result_hash['hashtag'] end |
#location ⇒ Hash
Returns a Hash with the results latitude and longitude values
23 24 25 |
# File 'lib/teleportd/search_result.rb', line 23 def location result_hash['loc'] end |
#mentions ⇒ Array
Returns the mentions of the search result in an Array NOTE: Will return nil unless you have an enterprise account
105 106 107 |
# File 'lib/teleportd/search_result.rb', line 105 def mentions result_hash['mention'] end |
#profile_pic_url ⇒ String
Returns the user’s profile pic url from the respective service account NOTE: Will return nil unless you have an enterprise account
81 82 83 |
# File 'lib/teleportd/search_result.rb', line 81 def profile_pic_url result_hash['pic'] end |
#sha ⇒ String
Returns a String representing the search result SHA hash
37 38 39 |
# File 'lib/teleportd/search_result.rb', line 37 def sha result_hash['sha'] end |
#source ⇒ String
Returns the source of the result (“twimg”, “instagram”, etc.)
51 52 53 |
# File 'lib/teleportd/search_result.rb', line 51 def source result_hash['src'] end |
#text ⇒ Array
Returns the comments or title of the search result in an Array NOTE: Will return nil unless you have an enterprise account
89 90 91 |
# File 'lib/teleportd/search_result.rb', line 89 def text result_hash['text'] end |
#thumbnail_url ⇒ String
Returns the thumbnail image url for the result
58 59 60 |
# File 'lib/teleportd/search_result.rb', line 58 def thumbnail_url result_hash['thb'] end |
#type ⇒ String
Returns a String representing the search result type (usually “image”)
30 31 32 |
# File 'lib/teleportd/search_result.rb', line 30 def type result_hash['typ'] end |
#users ⇒ Array
Returns the author handles identified from the result NOTE: Will return nil unless you have an enterprise account
73 74 75 |
# File 'lib/teleportd/search_result.rb', line 73 def users result_hash['usr'] end |