Class: Kanboard::Card
- Inherits:
-
Object
- Object
- Kanboard::Card
- Defined in:
- lib/kanboard/card.rb
Overview
Kanban card
Textile markupped text describing a card. a card is a line of text starting with a dash “-”
-
@adolfo fix this #bug: 234 (c:2013-02-15)
the card embeds information such as:
-
owner: @name
-
swimlane: +swimlane (at most one)
-
tags: #tag1, #tag2 (TODO)
-
creation date: c:
-
finish date: f:
-
due date: d:
the card stores also information which is defined elsewhere in the kanban file. This information includes:
-
project: the project the card refers to (set with a h1. tag in the file)
-
status: the current status of the card (set with a h2. tag in the file)
Constant Summary collapse
- GENERIC_SWIMLANE =
the swimlane for cards with no swimlane
"Generic"- NO_ONE =
the owned of cards not owned by anyone
"Unassigned"
Instance Attribute Summary collapse
-
#project ⇒ Object
Returns the value of attribute project.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
- #created ⇒ Object
- #done? ⇒ Boolean
- #due ⇒ Object
- #finished ⇒ Object
-
#initialize(project, status, title) ⇒ Card
constructor
A new instance of Card.
- #owner ⇒ Object
- #swimlane ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(project, status, title) ⇒ Card
Returns a new instance of Card.
31 32 33 34 35 |
# File 'lib/kanboard/card.rb', line 31 def initialize(project, status, title) @project = project @status = status @title = title[2, title.length] # forget about the initial "- " end |
Instance Attribute Details
#project ⇒ Object
Returns the value of attribute project.
29 30 31 |
# File 'lib/kanboard/card.rb', line 29 def project @project end |
#status ⇒ Object
Returns the value of attribute status.
29 30 31 |
# File 'lib/kanboard/card.rb', line 29 def status @status end |
Instance Method Details
#created ⇒ Object
45 46 47 |
# File 'lib/kanboard/card.rb', line 45 def created find("c:", @title) end |
#done? ⇒ Boolean
53 54 55 |
# File 'lib/kanboard/card.rb', line 53 def done? finished != nil end |
#due ⇒ Object
57 58 59 |
# File 'lib/kanboard/card.rb', line 57 def due find("d:", @title) end |
#finished ⇒ Object
49 50 51 |
# File 'lib/kanboard/card.rb', line 49 def finished find("f:", @title) end |
#owner ⇒ Object
37 38 39 |
# File 'lib/kanboard/card.rb', line 37 def owner find("@", @title) || NO_ONE end |
#swimlane ⇒ Object
41 42 43 |
# File 'lib/kanboard/card.rb', line 41 def swimlane find("\\+", @title) || GENERIC_SWIMLANE end |
#to_s ⇒ Object
61 62 63 |
# File 'lib/kanboard/card.rb', line 61 def to_s @title end |