Sha256: 8e8bc5434bd238d626cb7399104c47ef677485628dc5d29aaf4850ee974b5049

Contents?: true

Size: 635 Bytes

Versions: 21

Compression:

Stored size: 635 Bytes

Contents

require 'action_view'

module WoopleTheme
  module Dashboard
    class EssentialsSectionPresenter < SectionPresenter
      enforce_definitions :essentials_remaining,
                          :essentials_completed,
                          :essentials_exceptions

      def render_remaining
        yield if render?(section.essentials_remaining)
      end

      def render_completed
        yield if render?(section.essentials_completed)
      end

      def render_exceptions
        yield if render?(section.essentials_exceptions)
      end

      private

      def render?(tab)
        tab.count > 0
      end

    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
woople-theme-0.5.9 app/presenters/woople_theme/dashboard/essentials_section_presenter.rb