Sha256: 360192ce3c9fdbc435dec2abcc9b7d5b59e263ad47d6d100184d85d96880dd88

Contents?: true

Size: 566 Bytes

Versions: 1

Compression:

Stored size: 566 Bytes

Contents

module Troo
  module Commands
    module Add
      class List < Resource
        def add
          if created
            success
          else
            error_trello_error
          end
        end

        private

        def success
          "New list '#{value}' created."
        end

        def error_trello_error
          'List could not be created.'
        end

        def created
          @created ||= CreateList.for(resource, value)
        end

        def resource
          Retrieval::Board.retrieve(id)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
troo-0.0.8 lib/troo/commands/add/list.rb