Class: Agris::Api::DocumentQueryResponse
- Inherits:
-
Object
- Object
- Agris::Api::DocumentQueryResponse
- Defined in:
- lib/agris/api/document_query_response.rb
Instance Method Summary collapse
- #documents ⇒ Object
-
#initialize(output_hash, resource_type = nil) ⇒ DocumentQueryResponse
constructor
A new instance of DocumentQueryResponse.
- #last_request_date_time ⇒ Object
- #remarks ⇒ Object
Constructor Details
#initialize(output_hash, resource_type = nil) ⇒ DocumentQueryResponse
Returns a new instance of DocumentQueryResponse.
5 6 7 8 9 |
# File 'lib/agris/api/document_query_response.rb', line 5 def initialize(output_hash, resource_type = nil) @output_hash = output_hash @documents = nil @resource_type = resource_type if resource_type end |
Instance Method Details
#documents ⇒ Object
15 16 17 |
# File 'lib/agris/api/document_query_response.rb', line 15 def documents @documents ||= parse end |
#last_request_date_time ⇒ Object
11 12 13 |
# File 'lib/agris/api/document_query_response.rb', line 11 def last_request_date_time Time.parse(@output_hash[pluralized_resource_name]['system']['lastrequestdatetime']) end |
#remarks ⇒ Object
19 20 21 |
# File 'lib/agris/api/document_query_response.rb', line 19 def remarks resources.map { |r| r['remarks'] } end |