Module: Blush

Defined in:
lib/blush.rb,
lib/blush/railtie.rb,
lib/blush/version.rb,
lib/blush/presenter.rb,
lib/blush/helper_proxy.rb,
lib/blush/view_context.rb,
lib/blush/configuration.rb,
lib/blush/has_presenter.rb

Overview

Wrapper module for Blush

Defined Under Namespace

Modules: HasPresenter, ViewContext Classes: Configuration, HelperProxy, Presenter, Railtie

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.configObject

Convenient API for accessing Blush’s configuration

Options include:

Blush.config.accessor_name to set the default accessor on the model
Blush.config.helper_name to set the default helper name on the model


18
19
20
# File 'lib/blush.rb', line 18

module_function def config
  @config ||= Blush::Configuration.new
end

.helpersObject

Get the cached helpers



30
31
32
# File 'lib/blush.rb', line 30

module_function def helpers
  @helpers ||= Blush::HelperProxy.new
end

.helpers=(helper_proxy) ⇒ Object

Cache the helpers globally



24
25
26
# File 'lib/blush.rb', line 24

module_function def helpers=(helper_proxy)
  @helpers = helper_proxy
end

.view_contextObject

Get the cached view context



42
43
44
# File 'lib/blush.rb', line 42

module_function def view_context
  @view_context ||= ApplicationController.new.view_context
end

.view_context=(view_context) ⇒ Object

Cache the view context globally



36
37
38
# File 'lib/blush.rb', line 36

module_function def view_context=(view_context)
  @view_context = view_context
end