Class: HandleBranch
- Inherits:
-
Struct
- Object
- Struct
- HandleBranch
- Defined in:
- lib/git-pcheckout/handle_branch.rb
Instance Attribute Summary collapse
-
#branch ⇒ Object
Returns the value of attribute branch.
Instance Method Summary collapse
-
#initialize(branch) ⇒ HandleBranch
constructor
A new instance of HandleBranch.
- #perform ⇒ Object
Constructor Details
#initialize(branch) ⇒ HandleBranch
Returns a new instance of HandleBranch.
3 4 5 |
# File 'lib/git-pcheckout/handle_branch.rb', line 3 def initialize(branch) self.branch = branch end |
Instance Attribute Details
#branch ⇒ Object
Returns the value of attribute branch
1 2 3 |
# File 'lib/git-pcheckout/handle_branch.rb', line 1 def branch @branch end |
Instance Method Details
#perform ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/git-pcheckout/handle_branch.rb', line 7 def perform if branch_exists_locally? checkout_local_branch && pull_from_origin else fetch_from_origin && checkout_and_track_branch end end |