Class: Sidetree::Model::Chunk

Inherits:
Object
  • Object
show all
Defined in:
lib/sidetree/model/chunk.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(chunk_file_uri) ⇒ Chunk

Initializer

Parameters:

  • chunk_file_uri (String)

    chunk file uri.

Raises:



9
10
11
12
13
14
# File 'lib/sidetree/model/chunk.rb', line 9

def initialize(chunk_file_uri)
  unless chunk_file_uri.is_a?(String)
    raise Sidetree::Error, "chunk_file_uri must be String"
  end
  @chunk_file_uri = chunk_file_uri
end

Instance Attribute Details

#chunk_file_uriObject (readonly)

Returns the value of attribute chunk_file_uri.



4
5
6
# File 'lib/sidetree/model/chunk.rb', line 4

def chunk_file_uri
  @chunk_file_uri
end

Instance Method Details

#to_hObject



16
17
18
# File 'lib/sidetree/model/chunk.rb', line 16

def to_h
  { chunkFileUri: chunk_file_uri }
end