Class: Git::Stashes
Overview
object that holds all the available stashes
Instance Method Summary collapse
- #[](index)
-
#all ⇒ Array
Returns an multi-dimensional Array of elements that have been stash saved.
- #apply(index = nil)
- #clear
- #each(&block)
-
#initialize(base) ⇒ Stashes
constructor
A new instance of Stashes.
- #save(message)
- #size
Constructor Details
Instance Method Details
#[](index)
50 51 52 |
# File 'lib/git/stashes.rb', line 50 def [](index) @stashes[index.to_i] end |
#all ⇒ Array
Returns an multi-dimensional Array of elements that have been stash saved. Array is based on position and name. See Example
24 25 26 |
# File 'lib/git/stashes.rb', line 24 def all @base.lib.stashes_all end |
#apply(index = nil)
33 34 35 |
# File 'lib/git/stashes.rb', line 33 def apply(index=nil) @base.lib.stash_apply(index) end |
#clear
37 38 39 40 |
# File 'lib/git/stashes.rb', line 37 def clear @base.lib.stash_clear @stashes = [] end |
#each(&block)
46 47 48 |
# File 'lib/git/stashes.rb', line 46 def each(&block) @stashes.each(&block) end |
#save(message)
28 29 30 31 |
# File 'lib/git/stashes.rb', line 28 def save() s = Git::Stash.new(@base, ) @stashes.unshift(s) if s.saved? end |
#size
42 43 44 |
# File 'lib/git/stashes.rb', line 42 def size @stashes.size end |