Class: Droonga::Replier
- Inherits:
-
Object
- Object
- Droonga::Replier
- Includes:
- Loggable
- Defined in:
- lib/droonga/replier.rb
Instance Method Summary collapse
-
#initialize(forwarder) ⇒ Replier
constructor
A new instance of Replier.
- #reply(message) ⇒ Object
Constructor Details
#initialize(forwarder) ⇒ Replier
Returns a new instance of Replier.
23 24 25 |
# File 'lib/droonga/replier.rb', line 23 def initialize(forwarder) @forwarder = forwarder end |
Instance Method Details
#reply(message) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/droonga/replier.rb', line 27 def reply() logger.trace("reply: start") destination = ["replyTo"] = { "inReplyTo" => ["id"], "statusCode" => ["statusCode"] || StatusCode::OK, "type" => destination["type"], "body" => ["body"], } if .include?("errors") errors = ["errors"] ["errors"] = errors unless errors.empty? end @forwarder.forward(, destination) logger.trace("reply: done") end |