Class: LineClient
- Inherits:
-
Object
- Object
- LineClient
- Defined in:
- lib/linerb/client.rb
Instance Method Summary collapse
- #do_auth_service ⇒ Object
- #get_poll_service ⇒ Object
- #get_talk_service ⇒ Object
-
#initialize(auth_token:, certificate:) ⇒ LineClient
constructor
A new instance of LineClient.
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_service ⇒ Object
29 30 31 |
# File 'lib/linerb/client.rb', line 29 def do_auth_service Auth.new(auth_token: @auth, certificate: @cert).login end |
#get_poll_service ⇒ Object
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_service ⇒ Object
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 |