Class: HelperLoader

Inherits:
Loader
  • Object
show all
Defined in:
lib/shot_libs/helper_loader.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ HelperLoader

Returns a new instance of HelperLoader.



26
27
28
29
# File 'lib/shot_libs/helper_loader.rb', line 26

def initialize(client)
	super(client)
	@type = 'helper'
end

Instance Method Details

#get(helper_name) ⇒ Object



31
32
33
34
35
36
37
# 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