module Fog::Vsphere

Constants

VERSION

Public Class Methods

class_from_string(name, default_path = '') click to toggle source

This helper was originally added as Fog.class_as_string and moved to core but only used here

# File lib/fog/vsphere.rb, line 20
def self.class_from_string(name, default_path = '')
  const = default_path.empty? ? name.to_s : "#{default_path}::#{name}"
  klass = const.split('::').inject(Object) { |m, c| m.const_get(c) }
  return klass unless klass == Object
rescue NameError
  nil
end