Class: IdService::Client

Inherits:
Object
  • Object
show all
Includes:
Thrift::Client
Defined in:
lib/id_service/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/id_service/client.rb', line 12

def initialize(options = {})
  options.symbolize_keys!
  options = default_options.merge(options)

  @transport = Thrift::BufferedTransport.new(Thrift::Socket.new(options[:host], options[:port]))
  protocol = Thrift::BinaryProtocol.new(@transport)

  @iprot = protocol
  @oprot = options[:oprot] || protocol
  @seqid = 0
end

Instance Method Details

#get_idObject



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

def get_id()
  send_get_id()
  return recv_get_id()
end

#openObject



24
25
26
# File 'lib/id_service/client.rb', line 24

def open
  @transport.open
end