Module: Vermillion::Helper

Defined in:
lib/client/helper.rb,
lib/client/helper/time.rb,
lib/client/helper/network.rb,
lib/client/helper/results.rb,
lib/client/helper/endpoint.rb,
lib/client/helper/formatting.rb,
lib/client/helper/apicommunication.rb

Defined Under Namespace

Modules: ApiCommunication Classes: Endpoint, Formatting, Network, Results, Time

Class Method Summary collapse

Class Method Details

.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