Class: Ticard::TrelloRepository

Inherits:
Object
  • Object
show all
Defined in:
lib/ticard/trello_repository.rb

Instance Method Summary collapse

Constructor Details

#initialize(credentials = {}) ⇒ TrelloRepository

Returns a new instance of TrelloRepository.



6
7
8
9
10
11
# File 'lib/ticard/trello_repository.rb', line 6

def initialize(credentials={})
  Trello.configure do |config|
    config.developer_public_key = credentials["developer_public_key"]
    config.member_token = credentials["member_token"]
  end
end

Instance Method Details

#get(url) ⇒ Object



13
14
15
16
# File 'lib/ticard/trello_repository.rb', line 13

def get(url)
  in_trello = card_in_trello(url)
  Card.new(in_trello.desc, :url => url).as_stored
end

#put(card) ⇒ Object



18
19
20
21
22
# File 'lib/ticard/trello_repository.rb', line 18

def put(card)
  in_trello = card_in_trello(card.url)
  in_trello.desc = card.content
  in_trello.save
end