Class: DownloadConfig

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project_config:, block:) ⇒ DownloadConfig

Returns a new instance of DownloadConfig.



8
9
10
11
12
# File 'lib/jirametrics/download_config.rb', line 8

def initialize project_config:, block:
  @project_config = project_config
  @block = block
  @board_ids = []
end

Instance Attribute Details

#project_configObject (readonly)

Returns the value of attribute project_config.



6
7
8
# File 'lib/jirametrics/download_config.rb', line 6

def project_config
  @project_config
end

Instance Method Details

#board_ids(*ids) ⇒ Object



23
24
25
26
27
# File 'lib/jirametrics/download_config.rb', line 23

def board_ids *ids
  deprecated message: 'board_ids in the download block are deprecated. See https://github.com/mikebowler/jira-export/wiki/Deprecated'
  @board_ids = ids unless ids.empty?
  @board_ids
end

#filter_name(_filter = nil) ⇒ Object



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

def filter_name _filter = nil
  project_key
end

#jql(_query = nil) ⇒ Object



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

def jql _query = nil
  project_key
end

#project_key(_key = nil) ⇒ Object



18
19
20
21
# File 'lib/jirametrics/download_config.rb', line 18

def project_key _key = nil
  raise 'project, filter, and jql directives are no longer supported. See ' \
    'https://github.com/mikebowler/jira-export/wiki/Deprecated#project-filter-and-jql-are-no-longer-supported-in-the-download-section'
end

#rolling_date_count(count = nil) ⇒ Object



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

def rolling_date_count count = nil
  @rolling_date_count = count unless count.nil?
  @rolling_date_count
end

#runObject



14
15
16
# File 'lib/jirametrics/download_config.rb', line 14

def run
  instance_eval(&@block)
end