Class: MingleEventChanges::Changes

Inherits:
Object
  • Object
show all
Includes:
SAXMachine
Defined in:
lib/mingle_event_changes/change.rb

Constant Summary collapse

TYPES =
{
  'card-copied-to' => CardCopyChange,
  'card-copied-from' => CardCopyChange,
  'card-creation' => Change,
  'card-deletion' => Change,
  'card-type-change' => CardTypeChange,
  'description-change' => Change,
  'property-change' => PropertyChange,
  'name-change' => NameChange,
  'tag-addition' => TagChange,
  'tag-removal' => TagChange,
  'attachment-addition' => AttachmentChange,
  'attachment-removal' => AttachmentChange,
  'attachment-replacement' => AttachmentChange,
  'comment-addition' => CommentChange,
  'system-comment-addition' => CommentChange,
  'page-creation' => Change
}.each do |type, clazz|
  elements :change, :as => "#{type.gsub(/-/, '_')}_changes", :class => clazz, :with => {:type => type}
end

Instance Method Summary collapse

Instance Method Details

#changesObject



186
187
188
189
190
# File 'lib/mingle_event_changes/change.rb', line 186

def changes
  TYPES.keys.map do |k|
    send("#{k.gsub(/-/, '_')}_changes")
  end.flatten
end