Class: Git::Object::Blob

Inherits:
AbstractObject show all
Defined in:
lib/git/object.rb

Overview

A Git blob object

Instance Attribute Summary

Attributes inherited from AbstractObject

#mode, #objectish, #size, #type

Instance Method Summary collapse

Methods inherited from AbstractObject

#archive, #commit?, #contents, #contents_array, #diff, #grep, #log, #sha, #tag?, #to_s, #tree?

Constructor Details

#initialize(base, sha, mode = nil) ⇒ Blob

Creates a blob object wrapper

Parameters:

  • base (Git::Repository)

    the repository used to query object data

  • sha (String)

    the blob SHA or object expression

  • mode (String, nil) (defaults to: nil)

    the file mode from tree listings



275
276
277
278
# File 'lib/git/object.rb', line 275

def initialize(base, sha, mode = nil)
  super(base, sha)
  @mode = mode
end

Instance Method Details

#blob?Boolean

Returns whether this object is a blob

Returns:

  • (Boolean)

    true



284
285
286
# File 'lib/git/object.rb', line 284

def blob?
  true
end