Class: GitDiff::Hunk
- Inherits:
-
Object
- Object
- GitDiff::Hunk
- Defined in:
- lib/git_diff/hunk.rb
Instance Attribute Summary collapse
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
-
#range_info ⇒ Object
readonly
Returns the value of attribute range_info.
Instance Method Summary collapse
- #<<(string) ⇒ Object
-
#initialize(range_info) ⇒ Hunk
constructor
A new instance of Hunk.
- #stats ⇒ Object
Constructor Details
#initialize(range_info) ⇒ Hunk
Returns a new instance of Hunk.
9 10 11 12 |
# File 'lib/git_diff/hunk.rb', line 9 def initialize(range_info) @range_info = range_info @lines = [] end |
Instance Attribute Details
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
7 8 9 |
# File 'lib/git_diff/hunk.rb', line 7 def lines @lines end |
#range_info ⇒ Object (readonly)
Returns the value of attribute range_info.
7 8 9 |
# File 'lib/git_diff/hunk.rb', line 7 def range_info @range_info end |
Instance Method Details
#<<(string) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/git_diff/hunk.rb', line 14 def <<(string) Line.from_string(string).tap do |line| line_number_calculation.increment(line) lines << line end end |