Class: Git::Stashes
Overview
object that holds all the available stashes
Instance Method Summary collapse
- #[](index) ⇒ Object
- #apply(index = nil) ⇒ 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
39 40 41 |
# File 'lib/git/stashes.rb', line 39 def [](index) @stashes[index.to_i] end |
#apply(index = nil) ⇒ Object
22 23 24 |
# File 'lib/git/stashes.rb', line 22 def apply(index=nil) @base.lib.stash_apply(index) end |
#clear ⇒ Object
26 27 28 29 |
# File 'lib/git/stashes.rb', line 26 def clear @base.lib.stash_clear @stashes = [] end |
#each(&block) ⇒ Object
35 36 37 |
# File 'lib/git/stashes.rb', line 35 def each(&block) @stashes.each(&block) end |
#save(message) ⇒ Object
17 18 19 20 |
# File 'lib/git/stashes.rb', line 17 def save() s = Git::Stash.new(@base, ) @stashes.unshift(s) if s.saved? end |
#size ⇒ Object
31 32 33 |
# File 'lib/git/stashes.rb', line 31 def size @stashes.size end |