Module: ADAM6050::Handler
- Defined in:
- lib/adam6050/handler.rb,
lib/adam6050/handler/read.rb,
lib/adam6050/handler/login.rb,
lib/adam6050/handler/write.rb,
lib/adam6050/handler/status.rb
Overview
Handlers are, for the most part, simple transformations that accept a state, an incomming message, a session and a sender and produce a new state as well as an optional reply. The only
Defined Under Namespace
Classes: Login, Read, Status, Write
Constant Summary collapse
- MESSAGE_PREAMBLE =
Returns the first letters of the message that should be used when determining if the handler can handle it.
'$01'
Instance Method Summary collapse
- #handles?(msg) ⇒ true, false
-
#validate? ⇒ true
If the handler requires the sender to be validated.
Instance Method Details
#handles?(msg) ⇒ true, false
15 16 17 |
# File 'lib/adam6050/handler.rb', line 15 def handles?(msg) msg.start_with? self.class::MESSAGE_PREAMBLE end |
#validate? ⇒ true
Returns if the handler requires the sender to be validated.
20 21 22 |
# File 'lib/adam6050/handler.rb', line 20 def validate? true end |