class GitRecent::ReflogLine

Public Class Methods

new(line) click to toggle source
# File lib/git_recent/reflog_line.rb, line 3
def initialize(line)
  @line = line
end

Public Instance Methods

from_branch() click to toggle source
# File lib/git_recent/reflog_line.rb, line 7
def from_branch
  return unless is_checkout?
  split_line[-3]
end
to_branch() click to toggle source
# File lib/git_recent/reflog_line.rb, line 12
def to_branch
  return unless is_checkout?
  split_line.last
end

Private Instance Methods

is_checkout?() click to toggle source
# File lib/git_recent/reflog_line.rb, line 19
def is_checkout?
  @is_checkout ||= begin
    split_line[2] == 'checkout:'
  end
end
split_line() click to toggle source
# File lib/git_recent/reflog_line.rb, line 25
def split_line
  @split_line ||= @line.split(' ')
end