Class: Rugged::Diff::Line

Inherits:
Object
  • Object
show all
Defined in:
lib/rugged/diff/line.rb,
ext/rugged/rugged_diff_line.c

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



4
5
6
# File 'lib/rugged/diff/line.rb', line 4

def content
  @content
end

#content_offsetObject (readonly)

Returns the value of attribute content_offset.



4
5
6
# File 'lib/rugged/diff/line.rb', line 4

def content_offset
  @content_offset
end

#line_originObject (readonly)

Returns the value of attribute line_origin.



4
5
6
# File 'lib/rugged/diff/line.rb', line 4

def line_origin
  @line_origin
end

#new_linenoObject (readonly)

Returns the value of attribute new_lineno.



4
5
6
# File 'lib/rugged/diff/line.rb', line 4

def new_lineno
  @new_lineno
end

#old_linenoObject (readonly)

Returns the value of attribute old_lineno.



4
5
6
# File 'lib/rugged/diff/line.rb', line 4

def old_lineno
  @old_lineno
end

Instance Method Details

#addition?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/rugged/diff/line.rb', line 10

def addition?
  @line_origin == :addition
end

#binary?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/rugged/diff/line.rb', line 38

def binary?
  @line_origin == :binary
end

#context?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/rugged/diff/line.rb', line 6

def context?
  @line_origin == :context
end

#deletion?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/rugged/diff/line.rb', line 14

def deletion?
  @line_origin == :deletion
end

#eof_newline_added?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/rugged/diff/line.rb', line 22

def eof_newline_added?
  @line_origin == :eof_newline_added
end

#eof_newline_removed?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/rugged/diff/line.rb', line 26

def eof_newline_removed?
  @line_origin == :eof_newline_removed
end

#eof_no_newline?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/rugged/diff/line.rb', line 18

def eof_no_newline?
  @line_origin == :eof_no_newline
end

#file_header?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/rugged/diff/line.rb', line 30

def file_header?
  @line_origin == :file_header
end

#hunk_header?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/rugged/diff/line.rb', line 34

def hunk_header?
  @line_origin == :hunk_header
end

#inspectObject



42
43
44
# File 'lib/rugged/diff/line.rb', line 42

def inspect
  "#<#{self.class.name}:#{object_id} {line_origin: #{line_origin.inspect}, content: #{content.inspect}>"
end