Sha256: f728c7456fa9add32e4e378ff70946740ff349c701c91f6bf62bc28ff6bc14af

Contents?: true

Size: 929 Bytes

Versions: 4

Compression:

Stored size: 929 Bytes

Contents

require 'forwardable'

module Pakyow
  module Helpers
    module Context
      extend Forwardable

      def_delegators :@presenter, :store, :store=, :content, :view=,
      :template=, :page=, :path, :path=, :compose, :composer, :precompose!

      def view
        Presenter::ViewContext.new(presenter.view, self)
      end

      def partial(*args)
        Presenter::ViewContext.new(presenter.partial(*args), self)
      end

      def template
        Presenter::ViewContext.new(presenter.template, self)
      end

      def page
        Presenter::ViewContext.new(presenter.page, self)
      end

      def container(*args)
        Presenter::ViewContext.new(presenter.container(*args), self)
      end

      def bindings(name)
        presenter.bindings(name).bindings
      end

      def presenter
        @presenter
      end
    end

    module App
      def presenter
        @presenter
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pakyow-presenter-0.11.3 pakyow-presenter/lib/pakyow/presenter/helpers.rb
pakyow-presenter-0.11.2 pakyow-presenter/lib/pakyow/presenter/helpers.rb
pakyow-presenter-0.11.1 pakyow-presenter/lib/pakyow/presenter/helpers.rb
pakyow-presenter-0.11.0 pakyow-presenter/lib/pakyow/presenter/helpers.rb