Sha256: 93b460836c5c9ae4e854b9184c3abea3995ca7b6df9aa17adae808e9e398c9cd

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 KB

Contents

# stdlib
require 'singleton'

# gems
require 'active_support/concern'
require 'active_support/inflector'
require 'action_controller'

# internal
require 'oprah/cache'
require 'oprah/controller_helpers'
require 'oprah/presenter'
require 'oprah/version'

require 'oprah/railtie' if defined?(Rails)

# The Oprah namespace.
module Oprah
  # @!visibility private
  def debug?
    !!ENV["OPRAH_DEBUG"]
  end

  # Shortcut to {Oprah::Presenter#present}.
  #
  # @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)
  end

  # Shortcut to {Presenter#present_many}.
  #
  # @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)
  end

  extend self
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
oprah-0.1.1 lib/oprah.rb