Module: Rooibos::Shortcuts::Msg

Defined in:
lib/rooibos/shortcuts.rb

Overview

Short aliases for Message types.

App developers pattern-match against message types frequently. The full names (Rooibos::Message::HttpResponse) are verbose. These shortcuts save characters and improve readability.

Example

case message
in Msg::Timer[envelope: :dismiss]
  [model.with(notification: nil), nil]
in Msg::Http[status: 200, body:]
  [model.with(data: JSON.parse(body)), nil]
in Msg::Sh::Batch[status: 0, stdout:]
  [model.with(output: stdout), nil]
end

Defined Under Namespace

Modules: Sh

Constant Summary collapse

Timer =

Timer message type. Alias for Message::Timer.

Message::Timer
Clock =

Clock message type. Alias for Message::Clock.

Message::Clock
Rand =

Random value message type. Alias for Message::Random.

Message::Random
Http =

HTTP response message type. Alias for Message::HttpResponse.

Message::HttpResponse
All =

Aggregated parallel results. Alias for Message::All.

Message::All
Batch =

Batch completion signal. Alias for Message::Batch.

Message::Batch