Class: Git::Object
- Inherits:
-
Object
- Object
- Git::Object
- Defined in:
- lib/git/object.rb
Overview
represents a git object
Defined Under Namespace
Classes: AbstractObject, Blob, Commit, Tree
Class Method Summary collapse
-
.new(base, objectish, type = nil) ⇒ Git::Object::AbstractObject
if we're calling this, we don't know what type it is yet so this is our little factory method.
Class Method Details
.new(base, objectish, type = nil) ⇒ Git::Object::AbstractObject
if we're calling this, we don't know what type it is yet so this is our little factory method
532 533 534 535 536 537 538 539 540 541 |
# File 'lib/git/object.rb', line 532 def self.new(base, objectish, type = nil) type ||= object_repository_for(base).cat_file_type(objectish) klass = case type when /blob/ then Blob when /commit/ then Commit when /tree/ then Tree end klass.new(base, objectish) end |