Class: SubDiff::DiffCollection
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- SubDiff::DiffCollection
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/sub_diff/diff_collection.rb
Instance Attribute Summary collapse
-
#diffs ⇒ Object
readonly
Returns the value of attribute diffs.
-
#string ⇒ Object
readonly
Returns the value of attribute string.
Instance Method Summary collapse
- #changed? ⇒ Boolean
-
#initialize(string) ⇒ DiffCollection
constructor
A new instance of DiffCollection.
- #push(*args) ⇒ Object (also: #<<)
Constructor Details
#initialize(string) ⇒ DiffCollection
Returns a new instance of DiffCollection.
14 15 16 17 18 |
# File 'lib/sub_diff/diff_collection.rb', line 14 def initialize(string) @string = string @diffs = [] super(string) end |
Instance Attribute Details
#diffs ⇒ Object (readonly)
Returns the value of attribute diffs.
10 11 12 |
# File 'lib/sub_diff/diff_collection.rb', line 10 def diffs @diffs end |
#string ⇒ Object (readonly)
Returns the value of attribute string.
10 11 12 |
# File 'lib/sub_diff/diff_collection.rb', line 10 def string @string end |
Instance Method Details
#changed? ⇒ Boolean
20 21 22 |
# File 'lib/sub_diff/diff_collection.rb', line 20 def changed? diffs.any?(&:changed?) end |