Class: GitRecent::ReflogLine
- Inherits:
-
Object
- Object
- GitRecent::ReflogLine
- Defined in:
- lib/git_recent/reflog_line.rb
Instance Method Summary collapse
- #from_branch ⇒ Object
-
#initialize(line) ⇒ ReflogLine
constructor
A new instance of ReflogLine.
- #to_branch ⇒ Object
Constructor Details
#initialize(line) ⇒ ReflogLine
Returns a new instance of ReflogLine.
3 4 5 |
# File 'lib/git_recent/reflog_line.rb', line 3 def initialize(line) @line = line end |
Instance Method Details
#from_branch ⇒ Object
7 8 9 10 |
# File 'lib/git_recent/reflog_line.rb', line 7 def from_branch return unless is_checkout? split_line[-3] end |
#to_branch ⇒ Object
12 13 14 15 |
# File 'lib/git_recent/reflog_line.rb', line 12 def to_branch return unless is_checkout? split_line.last end |