Class: Ipfs::DagNode
- Inherits:
-
Object
- Object
- Ipfs::DagNode
- Defined in:
- lib/dagnode.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
Instance Method Summary collapse
-
#initialize(http_response) ⇒ DagNode
constructor
A new instance of DagNode.
Constructor Details
#initialize(http_response) ⇒ DagNode
7 8 9 10 11 12 13 |
# File 'lib/dagnode.rb', line 7 def initialize http_response if http_response.status.code == 200 @content = http_response.body else raise Error::InvalidDagNode.new JSON.parse(http_response.body)["Message"] end end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
5 6 7 |
# File 'lib/dagnode.rb', line 5 def content @content end |