Module: Openplacos::String
- Defined in:
- lib/openplacos/libclient.rb
Instance Method Summary collapse
-
#get_max_const ⇒ Object
this method extend string module.
Instance Method Details
#get_max_const ⇒ Object
this method extend string module. this module find out a module instance from it’s name (=string) ( “Openplacos::Analog” (=string) => Oenplacos::Analog (= module)
46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/openplacos/libclient.rb', line 46 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 |