Class: Bringit::BlobSnippet
- Inherits:
-
Object
- Object
- Bringit::BlobSnippet
- Includes:
- Linguist::BlobHelper
- Defined in:
- lib/bringit/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.
10 11 12 |
# File 'lib/bringit/blob_snippet.rb', line 10 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.
7 8 9 |
# File 'lib/bringit/blob_snippet.rb', line 7 def filename @filename end |
#lines ⇒ Object
Returns the value of attribute lines.
6 7 8 |
# File 'lib/bringit/blob_snippet.rb', line 6 def lines @lines end |
#ref ⇒ Object
Returns the value of attribute ref.
5 6 7 |
# File 'lib/bringit/blob_snippet.rb', line 5 def ref @ref end |
#startline ⇒ Object
Returns the value of attribute startline.
8 9 10 |
# File 'lib/bringit/blob_snippet.rb', line 8 def startline @startline end |
Instance Method Details
#data ⇒ Object
14 15 16 |
# File 'lib/bringit/blob_snippet.rb', line 14 def data lines&.join("\n") end |
#mode ⇒ Object
26 27 28 |
# File 'lib/bringit/blob_snippet.rb', line 26 def mode nil end |
#name ⇒ Object
18 19 20 |
# File 'lib/bringit/blob_snippet.rb', line 18 def name filename end |
#size ⇒ Object
22 23 24 |
# File 'lib/bringit/blob_snippet.rb', line 22 def size data.length end |