Class: ContentAddressableFile

Inherits:
Object
  • Object
show all
Includes:
ActsAsUploadedFile, SharedInterface
Defined in:
lib/content_addressable_file.rb,
lib/content_addressable_file/shared_interface.rb,
lib/content_addressable_file/read_only_storage.rb,
lib/content_addressable_file/acts_as_uploaded_file.rb

Defined Under Namespace

Modules: ActsAsUploadedFile, SharedInterface Classes: ReadOnlyStorage

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SharedInterface

#==, #content_addressable, #decode, #digest, #digest_hash_function, #digest_length, #hash

Methods included from ActsAsUploadedFile

included

Constructor Details

#initialize(id) ⇒ ContentAddressableFile

Creates a new content-addressable file wrapper that uses the given id as content hash, assuming that it is a content addressable multihash

Parameters:

  • id (String)

    the multihash that is the content-addressable



17
18
19
# File 'lib/content_addressable_file.rb', line 17

def initialize(id)
  self.id = id
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



10
11
12
# File 'lib/content_addressable_file.rb', line 10

def id
  @id
end