Sha256: 4fd04807a713969a767d3be59c32ecc123dac0ff53f2d0709855a092f01bbd00

Contents?: true

Size: 602 Bytes

Versions: 2

Compression:

Stored size: 602 Bytes

Contents

module Troo
  module Commands
    class ShowBoards
      class << self
        # @return []
        def dispatch
          new.render
        end
      end

      def initialize; end

      # @return []
      def render
        return presenter if resources.any?
        error
      end

      private

      def error
        "#{type.capitalize} cannot be found."
      end

      def type
        'boards'
      end

      def presenter
        Presenters::Board.all(resources)
      end

      def resources
        @resources ||= Troo::Retrieval::Local.all(Troo::Board)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
troo-0.0.12 lib/troo/cli/commands/show/show_boards.rb
troo-0.0.11 lib/troo/cli/commands/show/show_boards.rb