Sha256: fba733b26bb70cd6b3f2291fc1bb7ee03c5003132c484245d1e5a823268d5d91

Contents?: true

Size: 793 Bytes

Versions: 3

Compression:

Stored size: 793 Bytes

Contents

module Troo
  class ListPresenter
    class << self
      def render_show(list, options = {})
        new(list, options).render_show
      end
    end

    include DecoratorHelpers

    def initialize(list, options = {})
      @list   = list
      @options = options
    end

    def render_show
      spacing do
        print BoardDecorator.new(board).short

        indent do
          print ListDecorator.new(list).short

          if list.cards.any?
            list.cards.each do |card|
              indent do
                print CardDecorator.new(card).short
              end
            end
          else
            print_error "No cards were found."
          end
        end
      end
    end

    private
    attr_reader :list

    def board
      list.board
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
troo-0.0.4 lib/troo/display/list_presenter.rb
troo-0.0.3 lib/troo/display/list_presenter.rb
troo-0.0.2 lib/troo/display/list_presenter.rb