Class: IdService::Client
- Inherits:
-
Object
- Object
- IdService::Client
- Includes:
- Thrift::Client
- Defined in:
- lib/id_service/client.rb
Instance Method Summary collapse
- #get_id ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #open ⇒ Object
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( = {}) .symbolize_keys! = .merge() @transport = Thrift::BufferedTransport.new(Thrift::Socket.new([:host], [:port])) protocol = Thrift::BinaryProtocol.new(@transport) @iprot = protocol @oprot = [:oprot] || protocol @seqid = 0 end |
Instance Method Details
#get_id ⇒ Object
28 29 30 31 |
# File 'lib/id_service/client.rb', line 28 def get_id() send_get_id() return recv_get_id() end |
#open ⇒ Object
24 25 26 |
# File 'lib/id_service/client.rb', line 24 def open @transport.open end |