Class: LineClient
- Inherits:
-
Object
- Object
- LineClient
- Defined in:
- lib/linerb/client.rb
Instance Method Summary collapse
- #doAuthService ⇒ Object
- #getPollService ⇒ Object
- #getTalkService ⇒ Object
-
#initialize(authToken:, certificate:) ⇒ LineClient
constructor
A new instance of LineClient.
Constructor Details
#initialize(authToken:, certificate:) ⇒ LineClient
Returns a new instance of LineClient.
8 9 10 11 |
# File 'lib/linerb/client.rb', line 8 def initialize(authToken:, certificate:) @a = authToken @c = certificate end |
Instance Method Details
#doAuthService ⇒ Object
13 14 15 |
# File 'lib/linerb/client.rb', line 13 def doAuthService Auth.new(authToken: @a, certificate: @c).login end |
#getPollService ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/linerb/client.rb', line 28 def getPollService transport = Thrift::HTTPClientTransport.new(Config::POLL_SERVICE_V4_URL) transport.add_headers(Config::HEADERS) protocol = Thrift::CompactProtocol.new(transport) client = TalkService::Client.new(protocol) return client end |
#getTalkService ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/linerb/client.rb', line 17 def getTalkService transport = Thrift::HTTPClientTransport.new(Config::TALK_SERVICE_V4_URL) transport.add_headers(Config::HEADERS) protocol = Thrift::CompactProtocol.new(transport) client = TalkService::Client.new(protocol) return client end |