Class: BoardConfig

Inherits:
Object show all
Defined in:
lib/jirametrics/board_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, block:, project_config:) ⇒ BoardConfig

Returns a new instance of BoardConfig.



6
7
8
9
10
# File 'lib/jirametrics/board_config.rb', line 6

def initialize id:, block:, project_config:
  @id = id
  @block = block
  @project_config = project_config
end

Instance Attribute Details

#boardObject (readonly)

Returns the value of attribute board.



4
5
6
# File 'lib/jirametrics/board_config.rb', line 4

def board
  @board
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/jirametrics/board_config.rb', line 4

def id
  @id
end

#project_configObject (readonly)

Returns the value of attribute project_config.



4
5
6
# File 'lib/jirametrics/board_config.rb', line 4

def project_config
  @project_config
end

Instance Method Details

#cycletime(label = nil, &block) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/jirametrics/board_config.rb', line 19

def cycletime label = nil, &block
  if @board.cycletime
    raise "Cycletime has already been set for board #{id}. Did you also set it inside the html_report? " \
      'If so, remove it from there.'
  end

  @board.cycletime = CycleTimeConfig.new(parent_config: self, label: label, block: block)
end

#expedited_priority_names(*priority_names) ⇒ Object



28
29
30
# File 'lib/jirametrics/board_config.rb', line 28

def expedited_priority_names *priority_names
  @board.expedited_priority_names = priority_names
end

#runObject



12
13
14
15
16
17
# File 'lib/jirametrics/board_config.rb', line 12

def run
  @board = @project_config.all_boards[id]
  @board.expedited_priority_names = []

  instance_eval(&@block)
end