Class: Troo::Commands::Move::Card

Inherits:
Object
  • Object
show all
Defined in:
lib/troo/cli/commands/move/card.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(card_id, list_id, board_id = nil) ⇒ Object

Returns [].

Parameters:

  • []
  • []
  • []


19
20
21
# File 'lib/troo/cli/commands/move/card.rb', line 19

def initialize(card_id, list_id, board_id = nil)
  @card_id, @list_id, @board_id = card_id, list_id, board_id
end

Class Method Details

.dispatch(card_id, list_id, board_id = nil) ⇒ Object

Returns [].

Parameters:

  • []
  • []
  • []

Returns:



10
11
12
# File 'lib/troo/cli/commands/move/card.rb', line 10

def dispatch(card_id, list_id, board_id = nil)
  new(card_id, list_id, board_id).move
end

Instance Method Details

#moveObject

Returns [].

Returns:



24
25
26
27
28
29
30
# File 'lib/troo/cli/commands/move/card.rb', line 24

def move
  return 'Card cannot be found.'  if card_not_found?
  return 'List cannot be found.'  if list_not_found?
  return 'Board cannot be found.' if board_not_found?
  return success if moved
  error
end