Class Git::Object::AbstractObject
In: lib/git/object.rb
Parent: Object

Methods

contents   contents_array   diff   grep   log   new   setup   to_s  

Attributes

mode  [RW] 
sha  [RW] 
size  [RW] 
type  [RW] 

Public Class methods

[Source]

# File lib/git/object.rb, line 14
      def initialize(base, sha)
        @base = base
        @sha = sha.to_s
        @size = @base.lib.object_size(@sha)
        setup
      end

Public Instance methods

[Source]

# File lib/git/object.rb, line 21
      def contents
        @base.lib.object_contents(@sha)
      end

[Source]

# File lib/git/object.rb, line 25
      def contents_array
        self.contents.split("\n")
      end

[Source]

# File lib/git/object.rb, line 43
      def diff(objectish)
        Git::Diff.new(@base, @sha, objectish)
      end

[Source]

# File lib/git/object.rb, line 37
      def grep(string, path_limiter = nil, opts = {})
        default = {:object => @sha, :path_limiter => path_limiter}
        grep_options = default.merge(opts)
        @base.lib.grep(string, grep_options)
      end

[Source]

# File lib/git/object.rb, line 47
      def log(count = 30)
        Git::Log.new(@base, count).object(@sha)
      end

[Source]

# File lib/git/object.rb, line 29
      def setup
        raise NotImplementedError
      end

[Source]

# File lib/git/object.rb, line 33
      def to_s
        @sha
      end

[Validate]