Module: Locomotive::Plugin::RackAppHelpers::ClassMethods

Defined in:
lib/locomotive/plugin/rack_app_helpers.rb

Overview

Methods to be added to the plugin class

Instance Method Summary collapse

Instance Method Details

#mounted_rack_appObject

Gets the Rack app and sets up additional helper methods. This value is memoized and should be used to access the rack_app, rather than calling the rack_app class method directly.

Returns:

  • the Rack app with helper methods or nil if no Rack app is given



40
41
42
43
44
45
46
# File 'lib/locomotive/plugin/rack_app_helpers.rb', line 40

def mounted_rack_app
  @mounted_rack_app ||= self.rack_app.tap do |app|
    if app
      app.extend(HelperMethods)
    end
  end
end