Class: Dude::ProjectManagement::Trello::MoveTaskToList
- Inherits:
-
Object
- Object
- Dude::ProjectManagement::Trello::MoveTaskToList
- Defined in:
- lib/dude/project_management/trello/move_task_to_list.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(client, id:, list_name:) ⇒ MoveTaskToList
constructor
A new instance of MoveTaskToList.
Constructor Details
#initialize(client, id:, list_name:) ⇒ MoveTaskToList
Returns a new instance of MoveTaskToList.
9 10 11 12 13 |
# File 'lib/dude/project_management/trello/move_task_to_list.rb', line 9 def initialize(client, id:, list_name:) @client = client @id = id @list_name = list_name end |
Instance Method Details
#call ⇒ Object
15 16 17 18 19 |
# File 'lib/dude/project_management/trello/move_task_to_list.rb', line 15 def call response = client.get("/1/boards/#{Dude::SETTINGS.dig(:jira, :board_id)}/cards/#{id}", { fields: 'id' }) card_id = JSON.parse(response.body)['id'] client.put("/1/cards/#{card_id}", { idList: list_id }) end |