Module: LightIO::Module::Base

Included in:
Addrinfo, BasicSocket, File, IO, IPSocket, Socket, TCPServer, TCPSocket, Thread, ThreadsWait, UDPSocket, UNIXServer, UNIXSocket
Defined in:
lib/lightio/module/base.rb

Defined Under Namespace

Modules: Helper, NewHelper

Class Method Summary collapse

Class Method Details

.find_library_class(klass) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/lightio/module/base.rb', line 4

def find_library_class(klass)
  return LightIO::Library::Base.send(:nameless_classes)[klass] if klass.name.nil?
  name = klass.name
  namespace_index = name.rindex("::")
  class_name = namespace_index.nil? ? name : name[(namespace_index + 2)..-1]
  LightIO::Library.const_get(class_name)
end