Class: Teleportd::Get
- Inherits:
-
Object
- Object
- Teleportd::Get
- Defined in:
- lib/teleportd/get.rb
Instance Attribute Summary collapse
-
#sha ⇒ Object
readonly
Returns the value of attribute sha.
Instance Method Summary collapse
-
#initialize(sha_or_search_result) ⇒ Teleportd::Get
constructor
Accepts either a Teleportd::SearchResult or a string representing the sha of a result.
-
#result ⇒ Teleportd::GetSearchResult
Returns a Teleportd::GetSearchResult representing the get search.
Constructor Details
#initialize(sha_or_search_result) ⇒ Teleportd::Get
Accepts either a Teleportd::SearchResult or a string representing the sha of a result
10 11 12 13 |
# File 'lib/teleportd/get.rb', line 10 def initialize sha_or_search_result @sha = handle_sha(sha_or_search_result) @request = Request.new(request_uri) end |
Instance Attribute Details
#sha ⇒ Object (readonly)
Returns the value of attribute sha.
4 5 6 |
# File 'lib/teleportd/get.rb', line 4 def sha @sha end |
Instance Method Details
#result ⇒ Teleportd::GetSearchResult
Returns a Teleportd::GetSearchResult representing the get search
19 20 21 |
# File 'lib/teleportd/get.rb', line 19 def result @result ||= GetSearchResult.new(@request.parsed_response['hit']) end |