Class: Git::Stashes
Overview
object that holds all the available stashes
Instance Method Summary collapse
- #[](index) ⇒ Object
- #apply(index = 0) ⇒ Object
- #clear ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(base) ⇒ Stashes
constructor
A new instance of Stashes.
- #save(message) ⇒ Object
- #size ⇒ Object
Constructor Details
Instance Method Details
#[](index) ⇒ Object
42 43 44 |
# File 'lib/git/stashes.rb', line 42 def [](index) @stashes[index.to_i] end |
#apply(index = 0) ⇒ Object
25 26 27 |
# File 'lib/git/stashes.rb', line 25 def apply(index=0) @base.lib.stash_apply(index.to_i) end |
#clear ⇒ Object
29 30 31 32 |
# File 'lib/git/stashes.rb', line 29 def clear @base.lib.stash_clear @stashes = [] end |
#each(&block) ⇒ Object
38 39 40 |
# File 'lib/git/stashes.rb', line 38 def each(&block) @stashes.each(&block) end |
#save(message) ⇒ Object
20 21 22 23 |
# File 'lib/git/stashes.rb', line 20 def save() s = Git::Stash.new(@base, ) @stashes.unshift(s) if s.saved? end |
#size ⇒ Object
34 35 36 |
# File 'lib/git/stashes.rb', line 34 def size @stashes.size end |