pakyow-presenter/lib/presenter/helpers.rb in pakyow-presenter-0.8.0 vs pakyow-presenter/lib/presenter/helpers.rb in pakyow-presenter-0.9.0
- old
+ new
@@ -1,11 +1,34 @@
+require 'forwardable'
+
module Pakyow
+ module Helpers; end
+
module AppHelpers
extend Forwardable
- def_delegators :@presenter, :store, :store=, :content, :view, :view=,
- :partial, :template, :template=, :page, :page=, :path, :path=, :compose,
- :composer, :container
+ def_delegators :@presenter, :store, :store=, :content, :view=,
+ :template=, :page=, :path, :path=, :compose, :composer
+
+ def view
+ ViewContext.new(@presenter.view, context)
+ end
+
+ def partial(*args)
+ ViewContext.new(@presenter.partial(*args), context)
+ end
+
+ def template
+ ViewContext.new(@presenter.template, context)
+ end
+
+ def page
+ ViewContext.new(@presenter.page, context)
+ end
+
+ def container(*args)
+ ViewContext.new(@presenter.container(*args), context)
+ end
def presenter
@presenter
end