Class: PrettyDiff::Chunk
- Inherits:
-
Object
- Object
- PrettyDiff::Chunk
- Defined in:
- lib/pretty_diff/chunk.rb
Instance Attribute Summary collapse
-
#contents ⇒ Object
readonly
Returns the value of attribute contents.
-
#diff ⇒ Object
readonly
Returns the value of attribute diff.
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
-
#meta_info ⇒ Object
readonly
Returns the value of attribute meta_info.
Instance Method Summary collapse
-
#initialize(diff, meta_info, contents) ⇒ Chunk
constructor
A new instance of Chunk.
- #line_numbers ⇒ Object
Constructor Details
#initialize(diff, meta_info, contents) ⇒ Chunk
Returns a new instance of Chunk.
5 6 7 8 9 10 |
# File 'lib/pretty_diff/chunk.rb', line 5 def initialize(diff, , contents) @diff = diff @meta_info = @contents = contents @lines = find_lines end |
Instance Attribute Details
#contents ⇒ Object (readonly)
Returns the value of attribute contents.
3 4 5 |
# File 'lib/pretty_diff/chunk.rb', line 3 def contents @contents end |
#diff ⇒ Object (readonly)
Returns the value of attribute diff.
3 4 5 |
# File 'lib/pretty_diff/chunk.rb', line 3 def diff @diff end |
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
3 4 5 |
# File 'lib/pretty_diff/chunk.rb', line 3 def lines @lines end |
#meta_info ⇒ Object (readonly)
Returns the value of attribute meta_info.
3 4 5 |
# File 'lib/pretty_diff/chunk.rb', line 3 def @meta_info end |
Instance Method Details
#line_numbers ⇒ Object
12 13 14 |
# File 'lib/pretty_diff/chunk.rb', line 12 def line_numbers @_line_numbers ||= LineNumbers.new(diff, ) end |