Class: GitShizzle::Git::File

Inherits:
Object
  • Object
show all
Defined in:
lib/git_shizzle/git/file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ File

Returns a new instance of File.



7
8
9
10
11
12
# File 'lib/git_shizzle/git/file.rb', line 7

def initialize(params)
  @status_line = params[:status_line]
  @path = params[:path]
  @index_status = map params[:status][0]
  @work_tree_status = map params[:status][1]
end

Instance Attribute Details

#index_statusObject (readonly)

Returns the value of attribute index_status.



5
6
7
# File 'lib/git_shizzle/git/file.rb', line 5

def index_status
  @index_status
end

#pathObject (readonly)

Returns the value of attribute path.



5
6
7
# File 'lib/git_shizzle/git/file.rb', line 5

def path
  @path
end

#status_lineObject (readonly)

Returns the value of attribute status_line.



5
6
7
# File 'lib/git_shizzle/git/file.rb', line 5

def status_line
  @status_line
end

#work_tree_statusObject (readonly)

Returns the value of attribute work_tree_status.



5
6
7
# File 'lib/git_shizzle/git/file.rb', line 5

def work_tree_status
  @work_tree_status
end

Instance Method Details

#inspectObject



14
15
16
# File 'lib/git_shizzle/git/file.rb', line 14

def inspect
  "Path: #{path}: work tree #{@work_tree_status}, index #{@index_status}"
end