Class: IPFS::Content::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/ipfs/content/node.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#hashcodeObject (readonly)

Returns the value of attribute hashcode.



6
7
8
# File 'lib/ipfs/content/node.rb', line 6

def hashcode
  @hashcode
end

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