Class: Yobi::DiffChanges
- Inherits:
-
Object
- Object
- Yobi::DiffChanges
- Includes:
- Enumerable, Enumerable[DiffChange]
- Defined in:
- lib/yobi/repository/diff.rb,
sig/yobi.rbs
Overview
Enumerable over every DiffChange in a run.
Instance Method Summary collapse
-
#each {|change| ... } ⇒ Enumerator
If no block is given.
-
#initialize(output) ⇒ DiffChanges
constructor
A new instance of DiffChanges.
Constructor Details
#initialize(output) ⇒ DiffChanges
Returns a new instance of DiffChanges.
79 80 81 |
# File 'lib/yobi/repository/diff.rb', line 79 def initialize(output) @output = output end |
Instance Method Details
#each ⇒ void #each ⇒ Enumerator[DiffChange, void]
Returns if no block is given.
85 86 87 88 89 90 91 92 |
# File 'lib/yobi/repository/diff.rb', line 85 def each return enum_for(:each) unless block_given? @output.index["change"].each do |offset| line = @output.read_line_at(offset) yield DiffChange.new(JSON.parse(line)) end end |