Class: ShareNotify::SearchResponse
- Inherits:
-
Object
- Object
- ShareNotify::SearchResponse
- Defined in:
- lib/share_notify/search_response.rb
Defined Under Namespace
Classes: Document
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #count ⇒ Object
- #docs ⇒ Object
-
#initialize(response) ⇒ SearchResponse
constructor
A new instance of SearchResponse.
Constructor Details
#initialize(response) ⇒ SearchResponse
Returns a new instance of SearchResponse.
7 8 9 10 11 |
# File 'lib/share_notify/search_response.rb', line 7 def initialize(response) fail ArgumentError, 'API response is nil' if response.nil? @status = response.code @response = response.parsed_response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
4 5 6 |
# File 'lib/share_notify/search_response.rb', line 4 def response @response end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/share_notify/search_response.rb', line 4 def status @status end |
Instance Method Details
#count ⇒ Object
13 14 15 |
# File 'lib/share_notify/search_response.rb', line 13 def count response.fetch('count', 0) end |