Class: RailVerdict::Git::ChangedFile
- Inherits:
-
Object
- Object
- RailVerdict::Git::ChangedFile
- Defined in:
- lib/rail_verdict/git/context.rb
Instance Attribute Summary collapse
-
#binary ⇒ Object
Returns the value of attribute binary.
-
#lines_added ⇒ Object
readonly
Returns the value of attribute lines_added.
-
#lines_removed ⇒ Object
readonly
Returns the value of attribute lines_removed.
-
#new_path ⇒ Object
readonly
Returns the value of attribute new_path.
-
#old_path ⇒ Object
readonly
Returns the value of attribute old_path.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status:, path:, old_path:, new_path:, score:, binary: false, lines_added: nil, lines_removed: nil) ⇒ ChangedFile
constructor
A new instance of ChangedFile.
- #to_h ⇒ Object
Constructor Details
#initialize(status:, path:, old_path:, new_path:, score:, binary: false, lines_added: nil, lines_removed: nil) ⇒ ChangedFile
Returns a new instance of ChangedFile.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rail_verdict/git/context.rb', line 12 def initialize(status:, path:, old_path:, new_path:, score:, binary: false, lines_added: nil, lines_removed: nil) @status = status @path = path @old_path = old_path @new_path = new_path @score = score @binary = binary @lines_added = lines_added @lines_removed = lines_removed freeze end |
Instance Attribute Details
#binary ⇒ Object
Returns the value of attribute binary.
10 11 12 |
# File 'lib/rail_verdict/git/context.rb', line 10 def binary @binary end |
#lines_added ⇒ Object (readonly)
Returns the value of attribute lines_added.
9 10 11 |
# File 'lib/rail_verdict/git/context.rb', line 9 def lines_added @lines_added end |
#lines_removed ⇒ Object (readonly)
Returns the value of attribute lines_removed.
9 10 11 |
# File 'lib/rail_verdict/git/context.rb', line 9 def lines_removed @lines_removed end |
#new_path ⇒ Object (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_path ⇒ Object (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 |
#path ⇒ Object (readonly)
Returns the value of attribute path.
9 10 11 |
# File 'lib/rail_verdict/git/context.rb', line 9 def path @path end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
9 10 11 |
# File 'lib/rail_verdict/git/context.rb', line 9 def score @score end |
#status ⇒ Object (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_h ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/rail_verdict/git/context.rb', line 24 def to_h { "status" => status.to_s, "path" => path, "old_path" => old_path, "new_path" => new_path, "score" => score, "binary" => binary, "lines_added" => lines_added, "lines_removed" => lines_removed } end |