Class: Ipfs::DagNode

Inherits:
Object
  • Object
show all
Defined in:
lib/dagnode.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#contentObject (readonly)

Returns the value of attribute content.



5
6
7
# File 'lib/dagnode.rb', line 5

def content
  @content
end