Class: Datacite::Response
- Inherits:
-
Object
- Object
- Datacite::Response
- Defined in:
- lib/datacite/response.rb
Overview
The response object from the datacite API
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
Instance Method Summary collapse
- #doi ⇒ Object
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
7 8 9 |
# File 'lib/datacite/response.rb', line 7 def initialize(response) @body = response.body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
11 12 13 |
# File 'lib/datacite/response.rb', line 11 def body @body end |
Instance Method Details
#doi ⇒ Object
13 14 15 |
# File 'lib/datacite/response.rb', line 13 def doi body.dig("data", "id") end |