Class: LineClient

Inherits:
Object
  • Object
show all
Defined in:
lib/linerb/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(auth_token:, certificate:) ⇒ LineClient

Returns a new instance of LineClient.



6
7
8
9
# File 'lib/linerb/client.rb', line 6

def initialize(auth_token:, certificate:)
  @auth = auth_token
  @cert = certificate
end

Instance Method Details

#do_auth_serviceObject



29
30
31
# File 'lib/linerb/client.rb', line 29

def do_auth_service
  Auth.new(auth_token: @auth, certificate: @cert).
end

#get_poll_serviceObject



20
21
22
23
24
25
26
27
# File 'lib/linerb/client.rb', line 20

def get_poll_service
  transport = Thrift::HTTPClientTransport.new(Config::POLL_SERVICE_V4_URL)
  transport.add_headers(Config::HEADERS)

  protocol = Thrift::CompactProtocol.new(transport)

  TalkService::Client.new(protocol)
end

#get_talk_serviceObject



11
12
13
14
15
16
17
18
# File 'lib/linerb/client.rb', line 11

def get_talk_service
  transport = Thrift::HTTPClientTransport.new(Config::TALK_SERVICE_V4_URL)
  transport.add_headers(Config::HEADERS)

  protocol = Thrift::CompactProtocol.new(transport)

  TalkService::Client.new(protocol)
end