Method: Vermillion::Helper.load

Defined in:
lib/client/helper.rb

.load(klass, args = nil) ⇒ Object

Loads a helper class Params:

klass

String representing the class helper subclass you want to load

args

Optional arguments to pass to the class instance



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/client/helper.rb', line 7

def self.load(klass, args = nil)
  klass_instance = Vermillion::Helper.const_get(klass.capitalize)

  if klass_instance
    if args.nil?
      klass_instance.new
    else
      klass_instance.new(args)
    end
  else
    Notify.error("Class not found: #{klass.capitalize}")
  end
end