Sha256: 3ae28591d7a78bd3f6d3faa883958d7397a095f24a7f7a7b65443a5bc55af9e5

Contents?: true

Size: 462 Bytes

Versions: 5

Compression:

Stored size: 462 Bytes

Contents

require 'explicit_delegator'

module WoopleTheme
  module Dashboard
    class SectionPresenter < ExplicitDelegator
      enforce_definitions :title,
                          :enabled?

      def render
        yield if section.enabled?
      end

      def title
        section.title.titleize
      end

      def css_id
        section.title.parameterize + "-section"
      end

      private

      def section
        __getobj__
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
woople-theme-0.5.6 app/presenters/woople_theme/dashboard/section_presenter.rb
woople-theme-0.5.5 app/presenters/woople_theme/dashboard/section_presenter.rb
woople-theme-0.5.4 app/presenters/woople_theme/dashboard/section_presenter.rb
woople-theme-0.5.3 app/presenters/woople_theme/dashboard/section_presenter.rb
woople-theme-0.5.2 app/presenters/woople_theme/dashboard/section_presenter.rb