Class: Meshchat::Network::Incoming::RequestProcessor
- Inherits:
-
Object
- Object
- Meshchat::Network::Incoming::RequestProcessor
- Defined in:
- lib/meshchat/network/incoming/request_processor.rb
Overview
all this does is pull the encrypted message out of the received request
Instance Attribute Summary collapse
-
#_message_processor ⇒ Object
readonly
Returns the value of attribute _message_processor.
Instance Method Summary collapse
-
#initialize(network: NETWORK_LOCAL, message_dispatcher: nil, location: nil) ⇒ RequestProcessor
constructor
A new instance of RequestProcessor.
- #parse_content(content) ⇒ Object
- #process(request_body) ⇒ Object
Constructor Details
#initialize(network: NETWORK_LOCAL, message_dispatcher: nil, location: nil) ⇒ RequestProcessor
Returns a new instance of RequestProcessor.
10 11 12 13 14 15 16 |
# File 'lib/meshchat/network/incoming/request_processor.rb', line 10 def initialize(network: NETWORK_LOCAL, message_dispatcher: nil, location: nil) @_message_processor = MessageProcessor.new( network: network, message_dispatcher: , location: location ) end |
Instance Attribute Details
#_message_processor ⇒ Object (readonly)
Returns the value of attribute _message_processor.
8 9 10 |
# File 'lib/meshchat/network/incoming/request_processor.rb', line 8 def @_message_processor end |
Instance Method Details
#parse_content(content) ⇒ Object
24 25 26 27 |
# File 'lib/meshchat/network/incoming/request_processor.rb', line 24 def parse_content(content) content = JSON.parse(content) if content.is_a?(String) content['message'] end |
#process(request_body) ⇒ Object
19 20 21 22 |
# File 'lib/meshchat/network/incoming/request_processor.rb', line 19 def process(request_body) = parse_content(request_body) .process() end |