Class: Agris::Api::PostResult
- Inherits:
-
Struct
- Object
- Struct
- Agris::Api::PostResult
- Defined in:
- lib/agris/api/post_result.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response
4 5 6 |
# File 'lib/agris/api/post_result.rb', line 4 def response @response end |
Instance Method Details
#document_number ⇒ Object
5 6 7 |
# File 'lib/agris/api/post_result.rb', line 5 def document_number results['result']['document'] end |
#reject_reasons ⇒ Object
9 10 11 12 13 |
# File 'lib/agris/api/post_result.rb', line 9 def reject_reasons results['result']['rejects']['reject'] .compact .map { |rejection| rejection['reason'] } end |
#results ⇒ Object
15 16 17 |
# File 'lib/agris/api/post_result.rb', line 15 def results response.output_hash['results'] end |
#status ⇒ Object
19 20 21 |
# File 'lib/agris/api/post_result.rb', line 19 def status results.fetch('result', 'status' => 'No Result').fetch('status') end |