Class: Grit::GitRuby::Blob

Inherits:
GitObject show all
Defined in:
lib/grit/git-ruby/object.rb,
lib/grit/git-ruby/git_object.rb

Instance Attribute Summary collapse

Attributes inherited from GitObject

#repository

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from GitObject

#sha1

Constructor Details

#initialize(content, repository = nil) ⇒ Blob

Returns a new instance of Blob.


84
85
86
87
# File 'lib/grit/git-ruby/object.rb', line 84

def initialize(content, repository=nil)
  @content = content
  @repository = repository
end

Instance Attribute Details

#contentObject

Returns the value of attribute content


78
79
80
# File 'lib/grit/git-ruby/object.rb', line 78

def content
  @content
end

Class Method Details

.from_raw(rawobject, repository) ⇒ Object


80
81
82
# File 'lib/grit/git-ruby/object.rb', line 80

def self.from_raw(rawobject, repository)
  new(rawobject.content)
end

Instance Method Details

#raw_contentObject


93
94
95
# File 'lib/grit/git-ruby/object.rb', line 93

def raw_content
  @content
end

#typeObject


89
90
91
# File 'lib/grit/git-ruby/object.rb', line 89

def type
  :blob
end