Class: MingleEvents::Feed::Category
- Inherits:
-
Object
- Object
- MingleEvents::Feed::Category
- Defined in:
- lib/mingle_events/feed/category.rb
Overview
An Atom category, with a term and a scheme. Note that an Atom event can have any number of categories, including zero. All current Mingle categories are also defined here, as constants.
Constant Summary collapse
- MINGLE_SCHEME =
The Atom category scheme for all Mingle categories
'http://www.thoughtworks-studios.com/ns/mingle#categories'
- CARD =
Category for any event sourced by a card
Category.new('card', MINGLE_SCHEME)
- CARD_CREATION =
Category for any event that is the creation of a new card
Category.new('card-creation', MINGLE_SCHEME)
- CARD_COPIED_FROM =
Category for any event that is the copy of a card from one project to another
Category.new('card-copied-from', MINGLE_SCHEME)
- CARD_DELETION =
Category for any event that is the deletion of a card
Category.new('card-deletion', MINGLE_SCHEME)
- PROPERTY_CHANGE =
Category for any event that includes the change of a card’s property value
Category.new('property-change', MINGLE_SCHEME)
- CARD_TYPE_CHANGE =
Category for any event that includes the change of a card’s type
Category.new('card-type-change', MINGLE_SCHEME)
- COMMENT_ADDITION =
Category for any event that includes the commenting on a card
Category.new('comment-addition', MINGLE_SCHEME)
- SYSTEM_COMMENT_ADDITION =
Category for any event that incldues the Mingle server’s adding a comment to a card
Category.new('system-comment-addition', MINGLE_SCHEME)
- MANAGED_PROPERTY_VALUE_CHANGE =
For correction events:
Category.new("managed-property-value-change", MINGLE_SCHEME)
- PROPERTY_RENAME =
Category.new("property-rename", MINGLE_SCHEME)
- TAG_RENAME =
Category.new("tag-rename", MINGLE_SCHEME)
- PROPERTY_DELETION =
Category.new("property-deletion", MINGLE_SCHEME)
- CARD_TYPE_RENAME =
Category.new("card-type-rename", MINGLE_SCHEME)
- CARD_TYPE_DELETION =
Category.new("card-type-deletion", MINGLE_SCHEME)
- CARD_TYPE_AND_PROPERTY_DISASSOCIATION =
Category.new("card-type-and-property-disassociation", MINGLE_SCHEME)
- CARD_KEYWORDS_CHANGE =
Category.new("card-keywords-change", MINGLE_SCHEME)
- NUMERIC_PRECISION_CHANGE =
Category.new("numeric-precision-change", MINGLE_SCHEME)
- REPOSITORY_SETTINGS_CHANGE =
Category.new("repository-settings-change", MINGLE_SCHEME)
- PAGE =
Category for any event sourced by a wiki page
Category.new('page', MINGLE_SCHEME)
- PAGE_CREATION =
Category for any event that is the creation of a new wiki page
Category.new('page-creation', MINGLE_SCHEME)
- NAME_CHANGE =
Category for any event that includes a card or page name change
Category.new('name-change', MINGLE_SCHEME)
- DESCRIPTION_CHANGE =
Category for any event that includes a card or page description/content change
Category.new('description-change', MINGLE_SCHEME)
- TAG_ADDITION =
Category for any event that includes the tagging of a card or page
Category.new('tag-addition', MINGLE_SCHEME)
- TAG_REMOVAL =
Category for any event that includes the removal of a tag from a card or page
Category.new('tag-removal', MINGLE_SCHEME)
- ATTACHMENT_ADDITION =
Category for any event that includes the addition of an attachment to a card or page
Category.new('attachment-addition', MINGLE_SCHEME)
- ATTACHMENT_REMOVAL =
Category for any event that includes the removal of an attachment from a card or page
Category.new('attachment-removal', MINGLE_SCHEME)
- ATTACHMENT_REPLACEMENT =
Category for any event that includes the replacement of an attachment on a card or page
Category.new('attachment-replacement', MINGLE_SCHEME)
- REVISION_COMMIT =
Category for any event that is a revision or changeset commit
Category.new('revision-commit', MINGLE_SCHEME)
- @@categories_by_mingle_term =
{}
Instance Attribute Summary collapse
-
#scheme ⇒ Object
readonly
The category’s scheme.
-
#term ⇒ Object
readonly
The category’s term.
Class Method Summary collapse
-
.for_mingle_term(mingle_term) ⇒ Object
lookup a category by the text value of the term (mingle scheme is assumed).
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(term, scheme) ⇒ Category
constructor
A new instance of Category.
- #to_s ⇒ Object
Constructor Details
#initialize(term, scheme) ⇒ Category
Returns a new instance of Category.
16 17 18 19 20 |
# File 'lib/mingle_events/feed/category.rb', line 16 def initialize(term, scheme) @term = term @scheme = scheme @@categories_by_mingle_term[term] = self end |
Instance Attribute Details
#scheme ⇒ Object (readonly)
The category’s scheme
14 15 16 |
# File 'lib/mingle_events/feed/category.rb', line 14 def scheme @scheme end |
#term ⇒ Object (readonly)
The category’s term
12 13 14 |
# File 'lib/mingle_events/feed/category.rb', line 12 def term @term end |
Class Method Details
.for_mingle_term(mingle_term) ⇒ Object
lookup a category by the text value of the term (mingle scheme is assumed)
23 24 25 |
# File 'lib/mingle_events/feed/category.rb', line 23 def self.for_mingle_term(mingle_term) @@categories_by_mingle_term[mingle_term] end |
Instance Method Details
#==(other) ⇒ Object
31 32 33 |
# File 'lib/mingle_events/feed/category.rb', line 31 def ==(other) other.is_a?(Category) && other.term == self.term && other.scheme == self.scheme end |
#eql?(other) ⇒ Boolean
39 40 41 |
# File 'lib/mingle_events/feed/category.rb', line 39 def eql?(other) self == other end |
#hash ⇒ Object
35 36 37 |
# File 'lib/mingle_events/feed/category.rb', line 35 def hash term.hash ^ scheme.hash end |
#to_s ⇒ Object
27 28 29 |
# File 'lib/mingle_events/feed/category.rb', line 27 def to_s term end |