Class: Kanbanize::Task

Inherits:
Object
  • Object
show all
Defined in:
lib/kanbanize/task.rb

Constant Summary collapse

TASK_PRIORITIES =
['Low', 'Average', 'High']

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(board, attributes) ⇒ Task

Returns a new instance of Task.


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/kanbanize/task.rb', line 10

def initialize (board, attributes)
  @board = board

  set_id(attributes)
  set_column(attributes)
  set_lane(attributes)

  @title = attributes['title']
  @type = attributes['type']
  @assignee = attributes['assignee']
  @description = attributes['description']
  @color = attributes['color']
  @size = attributes['size']
  @tags = attributes['tags'].split(' ') if attributes['tags']
  @block_reason = attributes['blockedreason']

  @lead_time = attributes['leadtime'] ? check_integer(attributes['leadtime']) : nil
  @position = attributes['position'] ? check_integer(attributes['position']) : nil
  @logged_time = attributes['logedtime'] ? check_integer(attributes['logedtime']) : nil

  set_priority(attributes)
  set_block_status(attributes)
  set_deadline(attributes)
end

Instance Attribute Details

#assigneeObject (readonly)

Returns the value of attribute assignee


4
5
6
# File 'lib/kanbanize/task.rb', line 4

def assignee
  @assignee
end

#block_reasonObject (readonly)

Returns the value of attribute block_reason


4
5
6
# File 'lib/kanbanize/task.rb', line 4

def block_reason
  @block_reason
end

#colorObject (readonly)

Returns the value of attribute color


4
5
6
# File 'lib/kanbanize/task.rb', line 4

def color
  @color
end

#columnObject (readonly)

Returns the value of attribute column


4
5
6
# File 'lib/kanbanize/task.rb', line 4

def column
  @column
end

#deadlineObject (readonly)

Returns the value of attribute deadline


4
5
6
# File 'lib/kanbanize/task.rb', line 4

def deadline
  @deadline
end

#descriptionObject (readonly)

Returns the value of attribute description


4
5
6
# File 'lib/kanbanize/task.rb', line 4

def description
  @description
end

#idObject (readonly)

Returns the value of attribute id


4
5
6
# File 'lib/kanbanize/task.rb', line 4

def id
  @id
end

#laneObject (readonly)

Returns the value of attribute lane


4
5
6
# File 'lib/kanbanize/task.rb', line 4

def lane
  @lane
end

#lead_timeObject (readonly)

Returns the value of attribute lead_time


4
5
6
# File 'lib/kanbanize/task.rb', line 4

def lead_time
  @lead_time
end

#logged_timeObject (readonly)

Returns the value of attribute logged_time


4
5
6
# File 'lib/kanbanize/task.rb', line 4

def logged_time
  @logged_time
end

#positionObject (readonly)

Returns the value of attribute position


4
5
6
# File 'lib/kanbanize/task.rb', line 4

def position
  @position
end

#priorityObject (readonly)

Returns the value of attribute priority


4
5
6
# File 'lib/kanbanize/task.rb', line 4

def priority
  @priority
end

#sizeObject (readonly)

Returns the value of attribute size


4
5
6
# File 'lib/kanbanize/task.rb', line 4

def size
  @size
end

#tagsObject (readonly)

Returns the value of attribute tags


4
5
6
# File 'lib/kanbanize/task.rb', line 4

def tags
  @tags
end

#titleObject (readonly)

Returns the value of attribute title


4
5
6
# File 'lib/kanbanize/task.rb', line 4

def title
  @title
end

#typeObject (readonly)

Returns the value of attribute type


4
5
6
# File 'lib/kanbanize/task.rb', line 4

def type
  @type
end

Instance Method Details

#blocked?Boolean

Returns:

  • (Boolean)

35
36
37
# File 'lib/kanbanize/task.rb', line 35

def blocked?
  @blocked
end