module Openplacos::String

Public Instance Methods

get_max_const() click to toggle source

this method extend string module. this module find out a module instance from it’s name (=string) ( “Openplacos::Analog” (=string) => Oenplacos::Analog (= module)

# File lib/openplacos/libclient.rb, line 45
def get_max_const
  array = self.split("::")
  out = Kernel
  array.each { |mod|
    if out.const_defined?(mod)
      out = out.const_get(mod)
    else
      return out
    end
  }
  return out #Should never be here
end