class HelperLoader
Public Class Methods
new(client)
click to toggle source
Calls superclass method
# File lib/shot_libs/helper_loader.rb, line 26 def initialize(client) super(client) @type = 'helper' end
Public Instance Methods
get(helper_name)
click to toggle source
# File lib/shot_libs/helper_loader.rb, line 31 def get(helper_name) if helper_exists? helper_name load "./application/helpers/#{helper_name.underscore}.rb" else raise HelperLoadException "Could not find helper #{helper_name}. Please verify it exists at application/helpers/#{helper_name.underscore}.rb" end end
Private Instance Methods
helper_exists?(helper)
click to toggle source
# File lib/shot_libs/helper_loader.rb, line 41 def helper_exists?(helper) Dir.exists? 'application/helpers' and File.exists? "application/helpers/#{helper.underscore}.rb" end