Class: Nutrella::TaskBoard
- Inherits:
-
Object
- Object
- Nutrella::TaskBoard
- Defined in:
- lib/nutrella/task_board.rb
Overview
Knows how to use the Trello API to create and lookup task boards.
Instance Method Summary collapse
-
#initialize(configuration) ⇒ TaskBoard
constructor
A new instance of TaskBoard.
- #lookup_or_create(board_name) ⇒ Object
Constructor Details
#initialize(configuration) ⇒ TaskBoard
Returns a new instance of TaskBoard.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/nutrella/task_board.rb', line 10 def initialize(configuration) Trello.configure do |trello_client| trello_client.consumer_key = configuration.fetch(:key) trello_client.consumer_secret = configuration.fetch(:secret) trello_client.oauth_token = configuration.fetch(:token) trello_client.oauth_token_secret = configuration.fetch(:secret) end @organization = configuration.fetch(:organization) end |
Instance Method Details
#lookup_or_create(board_name) ⇒ Object
21 22 23 |
# File 'lib/nutrella/task_board.rb', line 21 def lookup_or_create(board_name) lookup(board_name) || create(board_name) end |