Class: Licensee::FilesystemRepository::Blob
- Inherits:
-
Struct
- Object
- Struct
- Licensee::FilesystemRepository::Blob
- Defined in:
- lib/licensee/filesystem_repository.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
Instance Method Summary collapse
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content
22 23 24 |
# File 'lib/licensee/filesystem_repository.rb', line 22 def content @content end |
Instance Method Details
#hashsig(options = 0) ⇒ Object
31 32 33 34 35 |
# File 'lib/licensee/filesystem_repository.rb', line 31 def hashsig( = 0) @hashsig ||= Rugged::Blob::HashSignature.new(content, ) rescue Rugged::InvalidError nil end |
#similarity(other) ⇒ Object
27 28 29 |
# File 'lib/licensee/filesystem_repository.rb', line 27 def similarity(other) self.hashsig ? Rugged::Blob::HashSignature.compare(self.hashsig, other) : 0 end |
#size ⇒ Object
23 24 25 |
# File 'lib/licensee/filesystem_repository.rb', line 23 def size content.size end |