class Git::Stashes
object that holds all the available stashes
Public Class Methods
Source
# File lib/git/stashes.rb, line 9 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 26 def all @base.lib.stashes_all end
Returns an multi-dimensional Array of elements that have been stash saved. Array is based on position and name. See Example
@example Returns Array of items that have been stashed
.all - [0, "testing-stash-all"]]
@return [Array]
Source
# File lib/git/stashes.rb, line 35 def apply(index=nil) @base.lib.stash_apply(index) end
Source
# File lib/git/stashes.rb, line 39 def clear @base.lib.stash_clear @stashes = [] end
Source
# File lib/git/stashes.rb, line 30 def save(message) s = Git::Stash.new(@base, message) @stashes.unshift(s) if s.saved? end