class Rugged::Diff::Hunk

Attributes

count[R]
header[R]
hunk_index[R]
line_count[R]
new_lines[R]
new_start[R]
old_lines[R]
old_start[R]
size[R]

Public Instance Methods

delta() click to toggle source
# File lib/rugged/diff/hunk.rb, line 9
def delta
  @owner
end
each
Also aliased as: each_line
each_line { |line| } → self
each_line → Enumerator

If given a block, yields each line that is part of the current hunk.

If no block is given, an enumerator is returned instead.

Alias for: each
inspect() click to toggle source
# File lib/rugged/diff/hunk.rb, line 13
def inspect
  "#<#{self.class.name}:#{object_id} {header: #{header.inspect}, count: #{count.inspect}}>"
end
lines() click to toggle source

Returns an Array containing all lines of the hunk.

# File lib/rugged/diff/hunk.rb, line 18
def lines
  each_line.to_a
end