Class: Leg::Diff::DiffSection
- Inherits:
-
Object
- Object
- Leg::Diff::DiffSection
- Defined in:
- lib/leg/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.
36 37 38 39 40 |
# File 'lib/leg/diff.rb', line 36 def initialize(type, line=nil) @type = type @lines = Array(line) @contents = [] end |
Instance Attribute Details
#contents ⇒ Object (readonly)
Returns the value of attribute contents.
34 35 36 |
# File 'lib/leg/diff.rb', line 34 def contents @contents end |
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
34 35 36 |
# File 'lib/leg/diff.rb', line 34 def lines @lines end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
34 35 36 |
# File 'lib/leg/diff.rb', line 34 def type @type end |
Instance Method Details
#<<(content) ⇒ Object
42 43 44 |
# File 'lib/leg/diff.rb', line 42 def <<(content) @contents << content end |
#dirty! ⇒ Object
46 |
# File 'lib/leg/diff.rb', line 46 def dirty!; @dirty = true; end |
#dirty? ⇒ Boolean
47 |
# File 'lib/leg/diff.rb', line 47 def dirty?; @dirty; end |