summaryrefslogtreecommitdiffstats
path: root/lib/git/object.rb
diff options
context:
space:
mode:
authorscott Chacon <schacon@agadorsparticus.(none)>2007-11-13 07:36:50 -0800
committerscott Chacon <schacon@agadorsparticus.(none)>2007-11-13 07:36:50 -0800
commit38f009d6d0aa35b13d19575611db1c724a9d1a5b (patch)
tree207d2ab90604cdd70870ea361aee635cc7ac4654 /lib/git/object.rb
parentb045fa6be8a299b114c89e25242118748ed3e6c6 (diff)
downloadthird_party-ruby-git-38f009d6d0aa35b13d19575611db1c724a9d1a5b.tar.gz
third_party-ruby-git-38f009d6d0aa35b13d19575611db1c724a9d1a5b.tar.xz
third_party-ruby-git-38f009d6d0aa35b13d19575611db1c724a9d1a5b.zip
updated a bunch of the documentation
Diffstat (limited to 'lib/git/object.rb')
-rw-r--r--lib/git/object.rb38
1 files changed, 22 insertions, 16 deletions
diff --git a/lib/git/object.rb b/lib/git/object.rb
index 4886f09..7702811 100644
--- a/lib/git/object.rb
+++ b/lib/git/object.rb
@@ -3,6 +3,7 @@ module Git
class GitTagNameDoesNotExist< StandardError
end
+ # represents a git object
class Object
class AbstractObject
@@ -57,9 +58,11 @@ module Git
@mode = mode
end
- def setup
- @type = 'blob'
- end
+ private
+
+ def setup
+ @type = 'blob'
+ end
end
class Tree < AbstractObject
@@ -72,10 +75,6 @@ module Git
@mode = mode
end
- def setup
- @type = 'tree'
- end
-
def children
blobs.merge(subtrees)
end
@@ -92,9 +91,13 @@ module Git
end
alias_method :subtrees, :trees
alias_method :subdirectories, :trees
-
+
private
+ def setup
+ @type = 'tree'
+ end
+
# actually run the git command
def check_tree
if !@trees
@@ -116,10 +119,6 @@ module Git
@committer = nil
@message = nil
- def setup
- @type = 'commit'
- end
-
def message
check_commit
@message
@@ -164,9 +163,13 @@ module Git
def diff_parent
diff(parent)
end
-
+
private
+ def setup
+ @type = 'commit'
+ end
+
# see if this object has been initialized and do so if not
def check_commit
if !@tree
@@ -189,9 +192,12 @@ module Git
@name = name
end
- def setup
- @type = 'tag'
- end
+ private
+
+ def setup
+ @type = 'tag'
+ end
+
end
class << self