Class: IdService::Client

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

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



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

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



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

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

#openObject



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

def open
  @transport.open
end