Module: Otaku::Client

Defined in:
lib/otaku/client.rb

Defined Under Namespace

Modules: EM

Class Method Summary collapse

Class Method Details

.get(data) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/otaku/client.rb', line 5

def get(data)
  EventMachine::run do
    EventMachine::connect(Otaku.address, Otaku.port, EM).
      execute(data) do |data|
        @result = Encoder.decode(data)
      end
  end
  @result
end