Class: Droonga::InputMessage
- Inherits:
-
Object
- Object
- Droonga::InputMessage
- Defined in:
- lib/droonga/input_message.rb
Instance Method Summary collapse
- #adapted_envelope ⇒ Object
- #add_route(route) ⇒ Object
- #body ⇒ Object
- #body=(body) ⇒ Object
- #command ⇒ Object
- #command=(command) ⇒ Object
-
#initialize(envelope) ⇒ InputMessage
constructor
A new instance of InputMessage.
Constructor Details
#initialize(envelope) ⇒ InputMessage
Returns a new instance of InputMessage.
20 21 22 |
# File 'lib/droonga/input_message.rb', line 20 def initialize(envelope) @envelope = envelope end |
Instance Method Details
#adapted_envelope ⇒ Object
24 25 26 27 28 29 |
# File 'lib/droonga/input_message.rb', line 24 def adapted_envelope # TODO: We can create adapted envelope non-destructively. # If it is not performance issue, it is better that we don't # change envelope destructively. Consider about it later. @envelope end |
#add_route(route) ⇒ Object
31 32 33 |
# File 'lib/droonga/input_message.rb', line 31 def add_route(route) @envelope["via"].push(route) end |
#body ⇒ Object
35 36 37 |
# File 'lib/droonga/input_message.rb', line 35 def body @envelope["body"] end |
#body=(body) ⇒ Object
39 40 41 |
# File 'lib/droonga/input_message.rb', line 39 def body=(body) @envelope["body"] = body end |
#command ⇒ Object
43 44 45 |
# File 'lib/droonga/input_message.rb', line 43 def command @envelope["type"] end |
#command=(command) ⇒ Object
47 48 49 |
# File 'lib/droonga/input_message.rb', line 47 def command=(command) @envelope["type"] = command end |