Class: ColumnsConfig

Inherits:
Object show all
Includes:
SelfOrIssueDispatcher
Defined in:
lib/jirametrics/columns_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SelfOrIssueDispatcher

#method_missing, #respond_to_missing?

Constructor Details

#initialize(file_config:, block:) ⇒ ColumnsConfig

Returns a new instance of ColumnsConfig.



10
11
12
13
14
# File 'lib/jirametrics/columns_config.rb', line 10

def initialize file_config:, block:
  @columns = []
  @file_config = file_config
  @block = block
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class SelfOrIssueDispatcher

Instance Attribute Details

#columnsObject (readonly)

Returns the value of attribute columns.



8
9
10
# File 'lib/jirametrics/columns_config.rb', line 8

def columns
  @columns
end

#file_configObject (readonly)

Returns the value of attribute file_config.



8
9
10
# File 'lib/jirametrics/columns_config.rb', line 8

def file_config
  @file_config
end

Instance Method Details

#column_entry_times(board_id: nil) ⇒ Object



37
38
39
40
41
# File 'lib/jirametrics/columns_config.rb', line 37

def column_entry_times board_id: nil
  @file_config.project_config.find_board_by_id(board_id).visible_columns.each do |column|
    date column.name, first_time_in_status(*column.status_ids)
  end
end

#date(label, proc) ⇒ Object



25
26
27
# File 'lib/jirametrics/columns_config.rb', line 25

def date label, proc
  @columns << [:date, label, proc]
end

#datetime(label, proc) ⇒ Object



29
30
31
# File 'lib/jirametrics/columns_config.rb', line 29

def datetime label, proc
  @columns << [:datetime, label, proc]
end

#runObject



16
17
18
# File 'lib/jirametrics/columns_config.rb', line 16

def run
  instance_eval(&@block)
end

#string(label, proc) ⇒ Object



33
34
35
# File 'lib/jirametrics/columns_config.rb', line 33

def string label, proc
  @columns << [:string, label, proc]
end

#write_headers(headers = nil) ⇒ Object



20
21
22
23
# File 'lib/jirametrics/columns_config.rb', line 20

def write_headers headers = nil
  @write_headers = headers unless headers.nil?
  @write_headers
end