Class: Linguist::LazyBlob
- Inherits:
-
Object
- Object
- Linguist::LazyBlob
- Includes:
- BlobHelper
- Defined in:
- lib/linguist/lazy_blob.rb
Constant Summary collapse
- MAX_SIZE =
128 * 1024
Constants included from BlobHelper
BlobHelper::MEGABYTE, BlobHelper::VendoredRegexp
Instance Attribute Summary collapse
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#oid ⇒ Object
readonly
Returns the value of attribute oid.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(repo, oid, name, mode = nil) ⇒ LazyBlob
constructor
A new instance of LazyBlob.
- #size ⇒ Object
Methods included from BlobHelper
#_mime_type, #binary?, #binary_mime_type?, #colorize, #content_type, #csv?, #detect_encoding, #disposition, #encoding, #extname, #generated?, #high_ratio_of_long_lines?, #image?, #language, #large?, #lexer, #likely_binary?, #lines, #loc, #mime_type, #pdf?, #ruby_encoding, #safe_to_colorize?, #sloc, #solid?, #text?, #vendored?, #viewable?
Constructor Details
#initialize(repo, oid, name, mode = nil) ⇒ LazyBlob
Returns a new instance of LazyBlob.
15 16 17 18 19 20 |
# File 'lib/linguist/lazy_blob.rb', line 15 def initialize(repo, oid, name, mode = nil) @repository = repo @oid = oid @name = name @mode = mode end |
Instance Attribute Details
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
13 14 15 |
# File 'lib/linguist/lazy_blob.rb', line 13 def mode @mode end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/linguist/lazy_blob.rb', line 12 def name @name end |
#oid ⇒ Object (readonly)
Returns the value of attribute oid.
11 12 13 |
# File 'lib/linguist/lazy_blob.rb', line 11 def oid @oid end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
10 11 12 |
# File 'lib/linguist/lazy_blob.rb', line 10 def repository @repository end |
Instance Method Details
#data ⇒ Object
22 23 24 25 |
# File 'lib/linguist/lazy_blob.rb', line 22 def data load_blob! @data end |
#size ⇒ Object
27 28 29 30 |
# File 'lib/linguist/lazy_blob.rb', line 27 def size load_blob! @size end |