Class: Nutrella::TaskBoard

Inherits:
Object
  • Object
show all
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

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