Class: Snaptoken::Diff::DiffSection

Inherits:
Object
  • Object
show all
Defined in:
lib/snaptoken/diff.rb

Direct Known Subclasses

DiffFile

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, line = nil) ⇒ DiffSection

Returns a new instance of DiffSection.



37
38
39
40
41
# File 'lib/snaptoken/diff.rb', line 37

def initialize(type, line=nil)
  @type = type
  @lines = Array(line)
  @contents = []
end

Instance Attribute Details

#contentsObject (readonly)

Returns the value of attribute contents.



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

def contents
  @contents
end

#linesObject (readonly)

Returns the value of attribute lines.



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

def lines
  @lines
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#<<(content) ⇒ Object



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

def <<(content)
  @contents << content
end

#dirty!Object



47
# File 'lib/snaptoken/diff.rb', line 47

def dirty!; @dirty = true; end

#dirty?Boolean

Returns:

  • (Boolean)


48
# File 'lib/snaptoken/diff.rb', line 48

def dirty?; @dirty; end