Class: Grit::GitRuby::Blob

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

Instance Attribute Summary collapse

Attributes inherited from GitObject

#repository, #sha

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.



95
96
97
98
# File 'lib/grit/git-ruby/git_object.rb', line 95

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

Instance Attribute Details

#contentObject

Returns the value of attribute content.



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

def content
  @content
end

Class Method Details

.from_raw(rawobject, repository) ⇒ Object



91
92
93
# File 'lib/grit/git-ruby/git_object.rb', line 91

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

Instance Method Details

#raw_contentObject



104
105
106
# File 'lib/grit/git-ruby/git_object.rb', line 104

def raw_content
  @content
end

#typeObject



100
101
102
# File 'lib/grit/git-ruby/git_object.rb', line 100

def type
  :blob
end