class Tantot::Changes::ByModel

Attributes

changes_by_model[R]

Public Class Methods

new(changes_by_model) click to toggle source
# File lib/tantot/changes.rb, line 37
def initialize(changes_by_model)
  @changes_by_model = changes_by_model
end

Public Instance Methods

==(other) click to toggle source
# File lib/tantot/changes.rb, line 44
def ==(other)
  other.changes_by_model == @changes_by_model
end
[](model) click to toggle source
# File lib/tantot/changes.rb, line 48
def [](model)
  for_model(model)
end
each(&block) click to toggle source
# File lib/tantot/changes.rb, line 52
def each(&block)
  @changes_by_model.each do |model, changes|
    block.call(model, Tantot::Changes::ById.new(changes))
  end
end
for_model(model) click to toggle source
# File lib/tantot/changes.rb, line 58
def for_model(model)
  Tantot::Changes::ById.new(@changes_by_model[model])
end