class Tantot::Changes::ById

Attributes

changes_by_id[R]

Public Class Methods

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

Public Instance Methods

==(other) click to toggle source
# File lib/tantot/changes.rb, line 15
def ==(other)
  other.changes_by_id == @changes_by_id
end
attributes() click to toggle source
# File lib/tantot/changes.rb, line 27
def attributes
  @changes_by_id.values.collect(&:keys).flatten.uniq.collect(&:to_sym)
end
for_attribute(attribute, compact = true) click to toggle source
# File lib/tantot/changes.rb, line 19
def for_attribute(attribute, compact = true)
  @changes_by_id.values.collect {|changes_by_attribute| changes_by_attribute[attribute.to_s]}.flatten.uniq.tap {|changes| changes.compact! if compact}
end
ids() click to toggle source
# File lib/tantot/changes.rb, line 23
def ids
  @changes_by_id.keys
end