Module: Locomotive::Plugin::RackAppHelpers::HelperMethods

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

Overview

Helper methods to be added to the Rack application.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#plugin_objectObject

Returns the value of attribute plugin_object.



10
11
12
# File 'lib/locomotive/plugin/rack_app_helpers.rb', line 10

def plugin_object
  @plugin_object
end

Instance Method Details

#full_path(path) ⇒ Object

Generate the full absolute path for the given path based on the mountpoint of this plugin’s rack app.

Parameters:

  • path (String)

    the path relative to the mountpoint of the rack app

Returns:

  • the absolute path



18
19
20
# File 'lib/locomotive/plugin/rack_app_helpers.rb', line 18

def full_path(path)
  plugin_object.rack_app_full_path(path)
end

#full_url(path) ⇒ Object

Generate the full URL for the given path based on the mountpoint of this plugin’s rack app.

Parameters:

  • path (String)

    the path relative to the mountpoint of the rack app

Returns:

  • the URL



28
29
30
# File 'lib/locomotive/plugin/rack_app_helpers.rb', line 28

def full_url(path)
  plugin_object.rack_app_full_url(path)
end