main
1class PokeMessage
2 attr_reader :fingerprint, :state
3
4 def initialize(fingerprint:, state: )
5 @fingerprint = fingerprint
6 @state = state
7 end
8
9 def routing_key
10 "commands.poke.#{fingerprint}"
11 end
12
13 def to_hash
14 {
15 fingerprint: fingerprint,
16 state: state
17 }
18 end
19
20 def to_json
21 to_hash.to_json
22 end
23end