enum PlaceOS::Edge::Protocol::Message::Body::Type
Defined in:
placeos-edge/protocol.crEnum Members
-
Debug =
0
-
-> Server
-
DriverLoaded =
1
-
DriverStatus =
2
-
Execute =
3
-
Ignore =
4
-
Kill =
5
-
Load =
6
-
LoadedModules =
7
-
ModuleLoaded =
8
-
RunCount =
9
-
Start =
10
-
Stop =
11
-
SystemStatus =
12
-
Unload =
13
-
Register =
14
-
-> Client
-
ProxyRedis =
15
-
FetchBinary =
16
-
SettingsAction =
17
-
Success =
18
-
Response
-
RegisterResponse =
19
-
-> Server
-
DebugMessage =
20
-
-> Client
-
DriverStatusResponse =
21
-
ExecuteResponse =
22
-
LoadedModulesResponse =
23
-
RunCountResponse =
24
-
SystemStatusResponse =
25
Instance Method Summary
- #debug?
- #debug_message?
- #driver_loaded?
- #driver_status?
- #driver_status_response?
- #execute?
- #execute_response?
- #fetch_binary?
- #ignore?
- #kill?
- #load?
- #loaded_modules?
- #loaded_modules_response?
- #module_loaded?
- #proxy_redis?
- #register?
- #register_response?
- #run_count?
- #run_count_response?
- #settings_action?
- #start?
- #stop?
- #success?
- #system_status?
- #system_status_response?
-
#to_json(json : JSON::Builder)
Serializes this enum member by name.
- #unload?
Instance Method Detail
def to_json(json : JSON::Builder)
#
Description copied from struct Enum
Serializes this enum member by name.
For non-flags enums, the serialization is a JSON string. The value is the
member name (see #to_s
) transformed with String#underscore
.
enum Stages
INITIAL
SECOND_STAGE
end
Stages::INITIAL.to_json # => %("initial")
Stages::SECOND_STAGE.to_json # => %("second_stage")
For flags enums, the serialization is a JSON array including every flagged
member individually serialized in the same way as a member of a non-flags enum.
None
is serialized as an empty array, All
as an array containing
all members.
@[Flags]
enum Sides
LEFT
RIGHT
end
Sides::LEFT.to_json # => %(["left"])
(Sides::LEFT | Sides::RIGHT).to_json # => %(["left","right"])
Sides::All.to_json # => %(["left","right"])
Sides::None.to_json # => %([])
ValueConverter.to_json
offers a different serialization strategy based on the
member value.