Class: ZooKeeper::Operation

Inherits:
Object
  • Object
show all
Defined in:
lib/zkruby/protocol.rb

Direct Known Subclasses

Packet

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(op, opcode, request, response, callback) ⇒ Operation

Returns a new instance of Operation.



66
67
68
69
70
# File 'lib/zkruby/protocol.rb', line 66

def initialize(op,opcode,request,response,callback)
    @op=op;@opcode=opcode
    @request=request;@response=response
    @callback=callback
end

Instance Attribute Details

#callbackObject (readonly)

Returns the value of attribute callback.



65
66
67
# File 'lib/zkruby/protocol.rb', line 65

def callback
  @callback
end

#opObject (readonly)

Returns the value of attribute op.



65
66
67
# File 'lib/zkruby/protocol.rb', line 65

def op
  @op
end

#opcodeObject (readonly)

Returns the value of attribute opcode.



65
66
67
# File 'lib/zkruby/protocol.rb', line 65

def opcode
  @opcode
end

#requestObject (readonly)

Returns the value of attribute request.



65
66
67
# File 'lib/zkruby/protocol.rb', line 65

def request
  @request
end

#responseObject (readonly)

Returns the value of attribute response.



65
66
67
# File 'lib/zkruby/protocol.rb', line 65

def response
  @response
end

Instance Method Details

#pathObject



72
73
74
75
76
# File 'lib/zkruby/protocol.rb', line 72

def path
    #Every request has a path!
    #TODO - path may be chrooted!
    request.path if request.respond_to?(:path)
end