Class: GitRecent::ReflogLine

Inherits:
Object
  • Object
show all
Defined in:
lib/git_recent/reflog_line.rb

Instance Method Summary collapse

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_branchObject



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_branchObject



12
13
14
15
# File 'lib/git_recent/reflog_line.rb', line 12

def to_branch
  return unless is_checkout?
  split_line.last
end