Class: RailVerdict::Git::ChangedFile

Inherits:
Object
  • Object
show all
Defined in:
lib/rail_verdict/git/context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status:, path:, old_path:, new_path:, score:, binary: false) ⇒ ChangedFile

Returns a new instance of ChangedFile.



12
13
14
15
16
17
18
19
20
# File 'lib/rail_verdict/git/context.rb', line 12

def initialize(status:, path:, old_path:, new_path:, score:, binary: false)
  @status = status
  @path = path
  @old_path = old_path
  @new_path = new_path
  @score = score
  @binary = binary
  freeze
end

Instance Attribute Details

#binaryObject

Returns the value of attribute binary.



10
11
12
# File 'lib/rail_verdict/git/context.rb', line 10

def binary
  @binary
end

#new_pathObject (readonly)

Returns the value of attribute new_path.



9
10
11
# File 'lib/rail_verdict/git/context.rb', line 9

def new_path
  @new_path
end

#old_pathObject (readonly)

Returns the value of attribute old_path.



9
10
11
# File 'lib/rail_verdict/git/context.rb', line 9

def old_path
  @old_path
end

#pathObject (readonly)

Returns the value of attribute path.



9
10
11
# File 'lib/rail_verdict/git/context.rb', line 9

def path
  @path
end

#scoreObject (readonly)

Returns the value of attribute score.



9
10
11
# File 'lib/rail_verdict/git/context.rb', line 9

def score
  @score
end

#statusObject (readonly)

Returns the value of attribute status.



9
10
11
# File 'lib/rail_verdict/git/context.rb', line 9

def status
  @status
end

Instance Method Details

#to_hObject



22
23
24
# File 'lib/rail_verdict/git/context.rb', line 22

def to_h
  { "status" => status.to_s, "path" => path, "old_path" => old_path, "new_path" => new_path, "score" => score, "binary" => binary }
end