Class Git::Stashes
In: lib/git/stashes.rb
Parent: Object

object that holds all the available stashes

Methods

[]   apply   clear   each   new   save   size  

Included Modules

Enumerable

Public Class methods

[Source]

# File lib/git/stashes.rb, line 10
    def initialize(base)
      @stashes = []
      
      @base = base
            
      @base.lib.stashes_all.each do |id, message|
        @stashes.unshift(Git::Stash.new(@base, message, true))
      end
    end

Public Instance methods

[Source]

# File lib/git/stashes.rb, line 44
    def [](index)
      @stashes[index.to_i]
    end

[Source]

# File lib/git/stashes.rb, line 25
    def apply(index=0)
      @base.lib.stash_apply(index.to_i)
    end

[Source]

# File lib/git/stashes.rb, line 29
    def clear
      @base.lib.stash_clear
      @stashes = []
    end

[Source]

# File lib/git/stashes.rb, line 38
    def each
      @stashes.each do |s|
        yield s
      end
    end

[Source]

# File lib/git/stashes.rb, line 20
    def save(message)
      s = Git::Stash.new(@base, message)
      @stashes.unshift(s) if s.saved?
    end

[Source]

# File lib/git/stashes.rb, line 34
    def size
      @stashes.size
    end

[Validate]