Class: LibraryLoader

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

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ LibraryLoader

Returns a new instance of LibraryLoader.



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

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

Instance Method Details

#get(library_name) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/shot_libs/library_loader.rb', line 31

def get(library_name)
  if helper_exists helper
    load "./application/libraries/#{library_name.underscore}.rb"
  else
    raise LibraryLoadException "Could not find library #{library_name}. Please verify it exists at application/libraries/#{library_name.underscore}.rb"
  end
end