Class: Kanbanize::Board::Column

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(board, attributes) ⇒ Column

Returns a new instance of Column.


6
7
8
9
10
# File 'lib/kanbanize/board/column.rb', line 6

def initialize(board, attributes)
  @board = board
  @name = attributes['lcname']
  @position = attributes['position'].to_i
end

Instance Attribute Details

#boardObject (readonly)

Returns the value of attribute board


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

def board
  @board
end

#nameObject (readonly)

Returns the value of attribute name


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

def name
  @name
end

#positionObject (readonly)

Returns the value of attribute position


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

def position
  @position
end

Instance Method Details

#==(other) ⇒ Object


12
13
14
# File 'lib/kanbanize/board/column.rb', line 12

def ==(other)
  @name == other.name && @position == other.position
end

#lane(name) ⇒ Object Also known as: []


16
17
18
# File 'lib/kanbanize/board/column.rb', line 16

def lane(name)
  Cell.new(self, @board.lane(name))
end

#tasksObject


21
22
23
# File 'lib/kanbanize/board/column.rb', line 21

def tasks
  @tasks ||= tasks!
end

#tasks!Object


25
26
27
# File 'lib/kanbanize/board/column.rb', line 25

def tasks!
  @tasks = @board.tasks!.select{|t| t.column == self}
end