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.



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

def content
  @content
end

#content_offsetObject (readonly)

Returns the value of attribute content_offset.



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

def content_offset
  @content_offset
end

#line_originObject (readonly)

Returns the value of attribute line_origin.



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

def line_origin
  @line_origin
end

#new_linenoObject (readonly)

Returns the value of attribute new_lineno.



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

def new_lineno
  @new_lineno
end

#old_linenoObject (readonly)

Returns the value of attribute old_lineno.



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

def old_lineno
  @old_lineno
end

Instance Method Details

#addition?Boolean

Returns:

  • (Boolean)


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

def addition?
  @line_origin == :addition
end

#binary?Boolean

Returns:

  • (Boolean)


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

def binary?
  @line_origin == :binary
end

#context?Boolean

Returns:

  • (Boolean)


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

def context?
  @line_origin == :context
end

#deletion?Boolean

Returns:

  • (Boolean)


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

def deletion?
  @line_origin == :deletion
end

#eof_newline_added?Boolean

Returns:

  • (Boolean)


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

def eof_newline_added?
  @line_origin == :eof_newline_added
end

#eof_newline_removed?Boolean

Returns:

  • (Boolean)


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

def eof_newline_removed?
  @line_origin == :eof_newline_removed
end

#eof_no_newline?Boolean

Returns:

  • (Boolean)


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

def eof_no_newline?
  @line_origin == :eof_no_newline
end

#file_header?Boolean

Returns:

  • (Boolean)


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

def file_header?
  @line_origin == :file_header
end

#hunk_header?Boolean

Returns:

  • (Boolean)


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

def hunk_header?
  @line_origin == :hunk_header
end

#inspectObject



47
48
49
# File 'lib/rugged/diff/line.rb', line 47

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