Class: WavesLib::Wrapper

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/waves_lib/wrapper.rb

Overview

Contains functions of waves library module

Instance Method Summary collapse

Constructor Details

#initialize(socket, paths) ⇒ Wrapper

Returns a new instance of Wrapper.



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/waves_lib/wrapper.rb', line 10

def initialize(socket, paths)
  @socket = T.let(socket, TCPSocket)

  paths.each do |path|
    method = path.split(".")[-1]

    define_singleton_method method.to_s do |*args|
      invoke(path, args)
    end
  end
end