Class: Jira::Auto::Tool::BoardController

Inherits:
Object
  • Object
show all
Defined in:
lib/jira/auto/tool/board_controller.rb,
lib/jira/auto/tool/board_controller/options.rb

Defined Under Namespace

Classes: Options

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tool) ⇒ BoardController

Returns a new instance of BoardController.



12
13
14
15
# File 'lib/jira/auto/tool/board_controller.rb', line 12

def initialize(tool)
  @tool = tool
  @jira_client = tool.jira_client
end

Instance Attribute Details

#jira_clientObject (readonly)

Returns the value of attribute jira_client.



10
11
12
# File 'lib/jira/auto/tool/board_controller.rb', line 10

def jira_client
  @jira_client
end

#toolObject (readonly)

Returns the value of attribute tool.



10
11
12
# File 'lib/jira/auto/tool/board_controller.rb', line 10

def tool
  @tool
end

Instance Method Details

#boardsObject



27
28
29
30
31
# File 'lib/jira/auto/tool/board_controller.rb', line 27

def boards
  return cached_boards if valid_cache?

  cache_boards(filtered_boards)
end

#clear_cacheObject



33
34
35
# File 'lib/jira/auto/tool/board_controller.rb', line 33

def clear_cache
  cache.clear
end

#list_boardsObject



17
18
19
20
21
22
23
24
25
# File 'lib/jira/auto/tool/board_controller.rb', line 17

def list_boards
  table = Terminal::Table.new(
    title: "Boards",
    headings: ["Project Key", "Name", "Board UI URL"],
    rows: boards.collect { |board| [board.project_key, board.name, board.ui_url] }
  )

  puts table
end