Class: Snaptoken::Diff::DiffSection
- Inherits:
-
Object
- Object
- Snaptoken::Diff::DiffSection
- Defined in:
- lib/snaptoken/diff.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#contents ⇒ Object
readonly
Returns the value of attribute contents.
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #<<(content) ⇒ Object
- #dirty! ⇒ Object
- #dirty? ⇒ Boolean
-
#initialize(type, line = nil) ⇒ DiffSection
constructor
A new instance of DiffSection.
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
#contents ⇒ Object (readonly)
Returns the value of attribute contents.
35 36 37 |
# File 'lib/snaptoken/diff.rb', line 35 def contents @contents end |
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
35 36 37 |
# File 'lib/snaptoken/diff.rb', line 35 def lines @lines end |
#type ⇒ Object (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
48 |
# File 'lib/snaptoken/diff.rb', line 48 def dirty?; @dirty; end |