Class Git::Branches
In: lib/git/branches.rb
Parent: Object

object that holds all the available branches

Methods

[]   each   local   new   remote   size  

Included Modules

Enumerable

Public Class methods

[Source]

# File lib/git/branches.rb, line 10
    def initialize(base)
      @branches = {}
      
      @base = base
            
      @base.lib.branches_all.each do |b|
        @branches[b[0]] = Git::Branch.new(@base, b[0])
      end
    end

Public Instance methods

[Source]

# File lib/git/branches.rb, line 40
    def [](symbol)
      @branches[symbol.to_s]
    end

[Source]

# File lib/git/branches.rb, line 34
    def each
      @branches.each do |k, b|
        yield b
      end
    end

[Source]

# File lib/git/branches.rb, line 20
    def local
      self.select { |b| !b.remote }
    end

[Source]

# File lib/git/branches.rb, line 24
    def remote
      self.select { |b| b.remote }
    end

array like methods

[Source]

# File lib/git/branches.rb, line 30
    def size
      @branches.size
    end

[Validate]