lib/oprah.rb in oprah-0.1.2 vs lib/oprah.rb in oprah-0.1.3

- old
+ new

@@ -3,10 +3,11 @@ require 'singleton' # gems require 'active_support/concern' require 'active_support/inflector' +require 'active_support/proxy_object' require 'action_controller' # internal require 'oprah/cache' require 'oprah/controller_helpers' @@ -14,31 +15,29 @@ require 'oprah/version' require 'oprah/railtie' if defined?(Rails) # The Oprah namespace. +# +# @since 0.0.1 module Oprah # @!visibility private def debug? !!ENV["OPRAH_DEBUG"] end - # Shortcut to {Oprah::Presenter#present}. + # Presents a single object. # - # @param object [Object] The object to present - # @param view_context [ActionView::Context] View context to assign - # @return [Presenter] Presented object - def present(object, view_context: Presenter.default_view_context) - Presenter.present(object, view_context: view_context) + # @see Presenter.present + def present(*args, **kwargs, &block) + Presenter.present(*args, **kwargs, &block) end - # Shortcut to {Presenter#present_many}. + # Presents a collection of objects. # - # @param objects [Enumerable] The objects to present - # @param view_context [ActionView::Context] View context to assign - # @return [Enumerable] Presented collection - def present_many(objects, view_context: Presenter.default_view_context) - Presenter.present_many(objects, view_context: view_context) + # @see Presenter.present_many + def present_many(*args, **kwargs, &block) + Presenter.present_many(*args, **kwargs, &block) end extend self end