Class Sipttra::Category
In: lib/webgen/sipttra_format.rb
Parent: Node
TextNode AdditionalText Comment Node Ticket Category Milestone Tracker lib/webgen/sipttra_format.rb Sipttra dot/m_47_0.png

Represents a category line.

Methods

new   tickets   to_line   to_s  

Attributes

name  [RW]  The name of the category.
type  [RW]  The type of the category.

Public Class methods

[Source]

    # File lib/webgen/sipttra_format.rb, line 76
76:     def initialize( name, type = nil )
77:       @name = name
78:       @type = type
79:       raise "Category must have a name" if name.nil?
80:     end

Public Instance methods

Returns all tickets belonging to this category.

[Source]

    # File lib/webgen/sipttra_format.rb, line 83
83:     def tickets
84:       tickets = []
85:       i = @tracker.nodes.index( self ) + 1
86:       while i < @tracker.nodes.length
87:         line = @tracker.nodes[i]
88:         break if line.kind_of?( Category )
89:         tickets << line if line.kind_of?( Ticket )
90:         i += 1
91:       end
92:       tickets
93:     end

[Source]

    # File lib/webgen/sipttra_format.rb, line 95
95:     def to_line
96:       '### ' + to_s + ' ###'
97:     end

[Source]

     # File lib/webgen/sipttra_format.rb, line 99
 99:     def to_s
100:       name + (type.nil? ? '' : ' (' + type + ')')
101:     end

[Validate]