Class: Rugged::Tree

### Home Classes Methods

### In Files

- lib/rugged/tree.rb

### Parent

Object

### Methods

- #diff
- #each_blob
- #each_tree
- #inspect
- #walk_blobs
- #walk_trees

### Included Modules

- Enumerable

### Class/Module Index

Quicksearch

- Rugged
- Rugged::Branch
- Rugged::Commit
- Rugged::Credentials
- Rugged::Credentials::Default
- Rugged::Credentials::SshKey
- Rugged::Credentials::SshKeyFromAgent
- Rugged::Credentials::UserPassword
- Rugged::Diff
- Rugged::Diff::Delta
- Rugged::Diff::Hunk
- Rugged::Diff::Line
- Rugged::Index
- Rugged::Object
- Rugged::Patch
- Rugged::Reference
- Rugged::Remote
- Rugged::Repository
- Rugged::Tag
- Rugged::Tag::Annotation
- Rugged::Tree
- Rugged::Walker
- Object

No matching classes.

# Rugged::Tree

### Attributes

owner[R]
repo[R]

### Public Instance Methods

diff(other = nil, options = nil) click to toggle source

    # File lib/rugged/tree.rb, line 8
    def diff(other = nil, options = nil)
      Tree.diff(repo, self, other, options)
    end

each_blob() click to toggle source

Iterate over the blobs in this tree

    # File lib/rugged/tree.rb, line 29
    def each_blob
      self.each { |e| yield e if e[:type] == :blob }
    end

each_tree() click to toggle source

Iterat over the subtrees in this tree

    # File lib/rugged/tree.rb, line 34
    def each_tree
      self.each { |e| yield e if e[:type] == :tree }
    end

inspect() click to toggle source

    # File lib/rugged/tree.rb, line 12
    def inspect
      data = "#<Rugged::Tree:#{object_id} {oid: #{oid}}>\n"
      self.each { |e| data << "  <\"#{e[:name]}\" #{e[:oid]}>\n" }
      data
    end

walk_blobs(mode=:postorder) click to toggle source

Walks the tree but only yields blobs

    # File lib/rugged/tree.rb, line 19
    def walk_blobs(mode=:postorder)
      self.walk(mode) { |root, e| yield root, e if e[:type] == :blob }
    end

walk_trees(mode=:postorder) click to toggle source

Walks the tree but only yields subtrees

    # File lib/rugged/tree.rb, line 24
    def walk_trees(mode=:postorder)
      self.walk(mode) { |root, e| yield root, e if e[:type] == :tree }
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.