Class: SubZero::Service::Handler

Inherits:
Object
  • Object
show all
Defined in:
lib/sub_zero/service/handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message) ⇒ Handler

Returns a new instance of Handler.



12
13
14
# File 'lib/sub_zero/service/handler.rb', line 12

def initialize message
  @message = message
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



5
6
7
# File 'lib/sub_zero/service/handler.rb', line 5

def message
  @message
end

Instance Method Details

#error(code, message) ⇒ Object



25
26
# File 'lib/sub_zero/service/handler.rb', line 25

def error code, message
end

#reply(*args) ⇒ Object

verb, payload = nil payload (same verb with :OK)



18
19
# File 'lib/sub_zero/service/handler.rb', line 18

def reply *args
end

#reply_with(payload) ⇒ Object



21
22
23
# File 'lib/sub_zero/service/handler.rb', line 21

def reply_with payload
  reply verb, payload
end