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