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.
40 41 42 43 44 |
# File 'lib/snaptoken/diff.rb', line 40 def initialize(type, line=nil) @type = type @lines = Array(line) @contents = [] end |
Instance Attribute Details
#contents ⇒ Object (readonly)
Returns the value of attribute contents.
38 39 40 |
# File 'lib/snaptoken/diff.rb', line 38 def contents @contents end |
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
38 39 40 |
# File 'lib/snaptoken/diff.rb', line 38 def lines @lines end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
38 39 40 |
# File 'lib/snaptoken/diff.rb', line 38 def type @type end |
Instance Method Details
#<<(content) ⇒ Object
46 47 48 |
# File 'lib/snaptoken/diff.rb', line 46 def <<(content) @contents << content end |
#dirty! ⇒ Object
50 |
# File 'lib/snaptoken/diff.rb', line 50 def dirty!; @dirty = true; end |
#dirty? ⇒ Boolean
51 |
# File 'lib/snaptoken/diff.rb', line 51 def dirty?; @dirty; end |