Class: Troo::Presenters::Board
- Inherits:
-
Object
- Object
- Troo::Presenters::Board
- Includes:
- DecoratorHelpers
- Defined in:
- lib/troo/presenters/board.rb
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(board, options = {}) ⇒ Troo::Presenters::Board constructor
-
#render_lists ⇒ Object
[].
-
#show ⇒ Object
[].
Methods included from DecoratorHelpers
Constructor Details
#initialize(board, options = {}) ⇒ Troo::Presenters::Board
19 20 21 |
# File 'lib/troo/presenters/board.rb', line 19 def initialize(board, = {}) @board, @options = board, end |
Class Method Details
.all(boards, options = {}) ⇒ NilClass
10 11 12 13 |
# File 'lib/troo/presenters/board.rb', line 10 def all(boards, = {}) boards.map { |board| new(board, ).show } nil end |
Instance Method Details
#render_lists ⇒ Object
Returns [].
39 40 41 42 43 44 45 46 47 |
# File 'lib/troo/presenters/board.rb', line 39 def render_lists output.spacer board.lists.map do |list| Presenters::List.new(list, output: output).render_list end nil end |
#show ⇒ Object
Returns [].
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/troo/presenters/board.rb', line 24 def show output.render Presenters::Resource.list_view(board) output.indent do if board.lists.empty? output.spacer do output.render error('No lists were found.') end else render_lists end end end |