Class: Gitlab::Git::BlobSnippet
- Inherits:
-
Object
- Object
- Gitlab::Git::BlobSnippet
- Includes:
- Linguist::BlobHelper
- Defined in:
- lib/gitlab_git/blob_snippet.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#lines ⇒ Object
Returns the value of attribute lines.
-
#ref ⇒ Object
Returns the value of attribute ref.
-
#startline ⇒ Object
Returns the value of attribute startline.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(ref, lines, startline, filename) ⇒ BlobSnippet
constructor
A new instance of BlobSnippet.
- #mode ⇒ Object
- #name ⇒ Object
- #size ⇒ Object
Constructor Details
#initialize(ref, lines, startline, filename) ⇒ BlobSnippet
Returns a new instance of BlobSnippet.
11 12 13 |
# File 'lib/gitlab_git/blob_snippet.rb', line 11 def initialize(ref, lines, startline, filename) @ref, @lines, @startline, @filename = ref, lines, startline, filename end |
Instance Attribute Details
#filename ⇒ Object
Returns the value of attribute filename.
8 9 10 |
# File 'lib/gitlab_git/blob_snippet.rb', line 8 def filename @filename end |
#lines ⇒ Object
Returns the value of attribute lines.
7 8 9 |
# File 'lib/gitlab_git/blob_snippet.rb', line 7 def lines @lines end |
#ref ⇒ Object
Returns the value of attribute ref.
6 7 8 |
# File 'lib/gitlab_git/blob_snippet.rb', line 6 def ref @ref end |
#startline ⇒ Object
Returns the value of attribute startline.
9 10 11 |
# File 'lib/gitlab_git/blob_snippet.rb', line 9 def startline @startline end |
Instance Method Details
#data ⇒ Object
15 16 17 |
# File 'lib/gitlab_git/blob_snippet.rb', line 15 def data lines.join("\n") if lines end |
#mode ⇒ Object
27 28 29 |
# File 'lib/gitlab_git/blob_snippet.rb', line 27 def mode nil end |
#name ⇒ Object
19 20 21 |
# File 'lib/gitlab_git/blob_snippet.rb', line 19 def name filename end |
#size ⇒ Object
23 24 25 |
# File 'lib/gitlab_git/blob_snippet.rb', line 23 def size data.length end |