Module: Tr3llo::API::Card
Instance Method Summary collapse
- #assign_members(card_id, members) ⇒ Object
- #find(card_id) ⇒ Object
- #find_all_by_board(board_id) ⇒ Object
- #find_all_by_list(list_id) ⇒ Object
- #find_all_by_user(board_id, user_id) ⇒ Object
- #move_to_list(card_id, list_id) ⇒ Object
Instance Method Details
#assign_members(card_id, members) ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/3llo/api/card.rb', line 65 def assign_members(card_id, members) url = "/cards/#{card_id}/idMembers" JSON.parse( client.put( url, key: api_key, token: api_token, value: members.join(',') ), symbolize_names: true ) end |
#find(card_id) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/3llo/api/card.rb', line 40 def find(card_id) JSON.parse( client.get( "/cards/#{card_id}", list: true, key: api_key, token: api_token, ), symbolize_names: true ) end |
#find_all_by_board(board_id) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/3llo/api/card.rb', line 6 def find_all_by_board(board_id) JSON.parse( client.get( "/boards/#{board_id}/cards", key: api_key, token: api_token, ), symbolize_names: true ) end |
#find_all_by_list(list_id) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/3llo/api/card.rb', line 17 def find_all_by_list(list_id) JSON.parse( client.get( "/lists/#{list_id}/cards", key: api_key, token: api_token, ), symbolize_names: true ) end |
#find_all_by_user(board_id, user_id) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/3llo/api/card.rb', line 28 def find_all_by_user(board_id, user_id) JSON.parse( client.get( "/boards/#{board_id}/members/#{user_id}/cards", list: true, key: api_key, token: api_token, ), symbolize_names: true ) end |
#move_to_list(card_id, list_id) ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/3llo/api/card.rb', line 52 def move_to_list(card_id, list_id) url = "/cards/#{card_id}/idList" JSON.parse( client.put( url, key: api_key, token: api_token, value: list_id ), symbolize_names: true ) end |