Class: Elasticsearch::Git::LiteBlob
- Inherits:
-
Object
- Object
- Elasticsearch::Git::LiteBlob
- Includes:
- EncoderHelper, Linguist::BlobHelper
- Defined in:
- lib/elasticsearch/git/lite_blob.rb
Instance Attribute Summary collapse
-
#commit_id ⇒ Object
Returns the value of attribute commit_id.
-
#data ⇒ Object
Returns the value of attribute data.
-
#id ⇒ Object
Returns the value of attribute id.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
-
#size ⇒ Object
Returns the value of attribute size.
Instance Method Summary collapse
-
#initialize(repo, raw_blob_hash) ⇒ LiteBlob
constructor
A new instance of LiteBlob.
Constructor Details
#initialize(repo, raw_blob_hash) ⇒ LiteBlob
Returns a new instance of LiteBlob.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/elasticsearch/git/lite_blob.rb', line 12 def initialize(repo, raw_blob_hash) @id = raw_blob_hash[:oid] blob = repo.lookup(@id) @mode = raw_blob_hash[:mode].to_s(8) @size = blob.size @path = encode!(raw_blob_hash[:path]) @name = @path.split('/').last @data = encode!(blob.content) end |
Instance Attribute Details
#commit_id ⇒ Object
Returns the value of attribute commit_id.
10 11 12 |
# File 'lib/elasticsearch/git/lite_blob.rb', line 10 def commit_id @commit_id end |
#data ⇒ Object
Returns the value of attribute data.
10 11 12 |
# File 'lib/elasticsearch/git/lite_blob.rb', line 10 def data @data end |
#id ⇒ Object
Returns the value of attribute id.
10 11 12 |
# File 'lib/elasticsearch/git/lite_blob.rb', line 10 def id @id end |
#mode ⇒ Object
Returns the value of attribute mode.
10 11 12 |
# File 'lib/elasticsearch/git/lite_blob.rb', line 10 def mode @mode end |
#name ⇒ Object
Returns the value of attribute name.
10 11 12 |
# File 'lib/elasticsearch/git/lite_blob.rb', line 10 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
10 11 12 |
# File 'lib/elasticsearch/git/lite_blob.rb', line 10 def path @path end |
#size ⇒ Object
Returns the value of attribute size.
10 11 12 |
# File 'lib/elasticsearch/git/lite_blob.rb', line 10 def size @size end |