Class: IPFS::Content::Node
- Inherits:
-
Object
- Object
- IPFS::Content::Node
- Defined in:
- lib/ipfs/content/node.rb
Instance Attribute Summary collapse
-
#hashcode ⇒ Object
readonly
Returns the value of attribute hashcode.
-
#links ⇒ Object
readonly
Returns the value of attribute links.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hashcode:, links:) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(hashcode:, links:) ⇒ Node
Returns a new instance of Node.
8 9 10 11 |
# File 'lib/ipfs/content/node.rb', line 8 def initialize(hashcode:, links:) @hashcode = hashcode @links = links end |
Instance Attribute Details
#hashcode ⇒ Object (readonly)
Returns the value of attribute hashcode.
6 7 8 |
# File 'lib/ipfs/content/node.rb', line 6 def hashcode @hashcode end |
#links ⇒ Object (readonly)
Returns the value of attribute links.
6 7 8 |
# File 'lib/ipfs/content/node.rb', line 6 def links @links end |
Class Method Details
.parse_array(array) ⇒ Object
13 14 15 16 17 |
# File 'lib/ipfs/content/node.rb', line 13 def self.parse_array(array) array.map do |item| new(hashcode: item['Hash'], links: Link.parse_array(item['Links'])) end end |