lib/troo/actions/create_board.rb in troo-0.0.7 vs lib/troo/actions/create_board.rb in troo-0.0.8

- old
+ new

@@ -4,29 +4,32 @@ def with(name, description = nil) new(name, description).perform end end - attr_reader :name - def initialize(name, description = nil) @name = name @description = description end def perform - update_boards + create_local end private + attr_reader :name, :description - def update_boards - return BoardPersistence.for(create_board) if create_board - false + def create_local + if create_remote + Persistence::Board.for(create_remote) + # refresh for lists + else + false + end end - def create_board + def create_remote @board ||= Trello::Board.create(attributes) rescue Trello::InvalidAccessToken raise Troo::InvalidAccessToken rescue Trello::Error false