Class: GitDiff::Line::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/git_diff/line/context.rb

Direct Known Subclasses

Addition, Deletion

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content, line_number = nil) ⇒ Context

Returns a new instance of Context.



8
9
10
11
# File 'lib/git_diff/line/context.rb', line 8

def initialize(content, line_number = nil)
  @content = content
  @line_number = line_number
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



6
7
8
# File 'lib/git_diff/line/context.rb', line 6

def content
  @content
end

#line_numberObject

Returns the value of attribute line_number.



6
7
8
# File 'lib/git_diff/line/context.rb', line 6

def line_number
  @line_number
end

Instance Method Details

#addition?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/git_diff/line/context.rb', line 21

def addition?
  false
end

#deletion?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/git_diff/line/context.rb', line 17

def deletion?
  false
end

#to_sObject



25
26
27
# File 'lib/git_diff/line/context.rb', line 25

def to_s
  content
end