Class: Ipfs::DagStream
- Inherits:
-
Object
- Object
- Ipfs::DagStream
- Defined in:
- lib/ruby-ipfs-http-client/dagstream.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
Instance Method Summary collapse
-
#initialize(response) ⇒ DagStream
constructor
A new instance of DagStream.
- #to_s ⇒ Object (also: #to_str)
Constructor Details
#initialize(response) ⇒ DagStream
Returns a new instance of DagStream.
7 8 9 10 11 12 13 |
# File 'lib/ruby-ipfs-http-client/dagstream.rb', line 7 def initialize(response) if response.status.code == 200 @content = response.body.to_s else raise Error::InvalidDagStream, JSON.parse(response.body)['Message'] end end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
5 6 7 |
# File 'lib/ruby-ipfs-http-client/dagstream.rb', line 5 def content @content end |
Instance Method Details
#to_s ⇒ Object Also known as: to_str
15 16 17 |
# File 'lib/ruby-ipfs-http-client/dagstream.rb', line 15 def to_s @content end |