Class: TelegramBot::TrelloConnector

Inherits:
Object
  • Object
show all
Defined in:
lib/telegram-bot/trello.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(username:, repository:) ⇒ TrelloConnector

Returns a new instance of TrelloConnector.



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/telegram-bot/trello.rb', line 23

def initialize(username:, repository:)
  @statistics        = { boards_created: 0, lists_created: 0, cards_created: 0 }
  @github_username   = username
  @github_repository = repository
  @board_name        = @github_repository.split(/[-_]/i).map(&:capitalize).join(' ')

  @board = find_or_create_board_by_name
  create_scrum_lists(@board)
  close_default_lists(@board)
  populate_issues_cards
end

Instance Attribute Details

#board_nameObject (readonly)

Returns the value of attribute board_name.



21
22
23
# File 'lib/telegram-bot/trello.rb', line 21

def board_name
  @board_name
end

#github_repositoryObject (readonly)

Returns the value of attribute github_repository.



21
22
23
# File 'lib/telegram-bot/trello.rb', line 21

def github_repository
  @github_repository
end

#github_usernameObject (readonly)

Returns the value of attribute github_username.



21
22
23
# File 'lib/telegram-bot/trello.rb', line 21

def github_username
  @github_username
end

#statisticsObject (readonly)

Returns the value of attribute statistics.



21
22
23
# File 'lib/telegram-bot/trello.rb', line 21

def statistics
  @statistics
end

Instance Method Details

#show_statisticsObject



35
36
37
38
39
40
41
# File 'lib/telegram-bot/trello.rb', line 35

def show_statistics
  "Estadisticas del proceso:\n" +
  "-" * 25 + "\n" +
  "Tableros Creados: #{@statistics[:boards_created]}\n" +
  "Listas Creadas:   #{@statistics[:lists_created]}\n" +
  "Tarjetas Creadas: #{@statistics[:cards_created]}\n"
end