Class: Git::Branches
Overview
object that holds all the available branches
Instance Method Summary collapse
- #[](symbol) ⇒ Object
- #each ⇒ Object
-
#initialize(base) ⇒ Branches
constructor
A new instance of Branches.
- #local ⇒ Object
- #remote ⇒ Object
-
#size ⇒ Object
array like methods.
Constructor Details
Instance Method Details
#[](symbol) ⇒ Object
40 41 42 |
# File 'lib/git/branches.rb', line 40 def [](symbol) @branches[symbol.to_s] end |
#each ⇒ Object
34 35 36 37 38 |
# File 'lib/git/branches.rb', line 34 def each @branches.each do |k, b| yield b end end |
#local ⇒ Object
20 21 22 |
# File 'lib/git/branches.rb', line 20 def local self.select { |b| !b.remote } end |
#remote ⇒ Object
24 25 26 |
# File 'lib/git/branches.rb', line 24 def remote self.select { |b| b.remote } end |
#size ⇒ Object
array like methods
30 31 32 |
# File 'lib/git/branches.rb', line 30 def size @branches.size end |