Class: Rfix::File::Base

Inherits:
Dry::Struct
  • Object
show all
Includes:
Dry::Core::Constants, Log
Defined in:
lib/rfix/file/base.rb

Direct Known Subclasses

Deleted, Ignored, Undefined, Untracked

Constant Summary collapse

UNTRACKED =
%i[worktree_new index_new].freeze
DELETED =
%i[deleted worktree_deleted].freeze
IGNORED =
%i[ignored unmodified].freeze
TRACKED =
[:added].freeze

Instance Method Summary collapse

Methods included from Log

prompt, say, say!

Instance Method Details

#contains?(file) ⇒ Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/rfix/file/base.rb', line 61

def contains?(file)
  path == file
end

#exists?Boolean

Returns:

  • (Boolean)


69
70
71
# File 'lib/rfix/file/base.rb', line 69

def exists?
  false
end

#inspectObject



65
66
67
# File 'lib/rfix/file/base.rb', line 65

def inspect
  "<#{self.class.name.demodulize}(#{status.join(', ')}:#{self})>"
end

#keyObject

Raises:

  • (NotImplementedError)


53
54
55
# File 'lib/rfix/file/base.rb', line 53

def key
  raise NotImplementedError
end

#linesObject



57
58
59
# File 'lib/rfix/file/base.rb', line 57

def lines
  EMPTY_ARRAY
end

#to_tableObject



49
50
51
# File 'lib/rfix/file/base.rb', line 49

def to_table
  [basename]
end