Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/messaging/handle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ def message_registry
end
end

## Can't null-coalesce here. It's a boolean. Use expanded form of `if` block - Scott, Mon Oct 16 2023
def strict
@strict ||= Defaults.strict
@strict = Defaults.strict if @strict.nil?
@strict
end
alias :strict? :strict

Expand All @@ -174,7 +174,7 @@ def call(message_or_message_data, strict: nil)
end

def handle_message(message, strict: nil)
strict ||= self.strict?
strict = self.strict? if strict.nil?

handler_logger.trace(tags: [:dispatch, :message]) { "Dispatching message (Message class: #{message.class.name})" }
handler_logger.trace(tags: [:data, :message]) { message.pretty_inspect }
Expand Down Expand Up @@ -202,7 +202,7 @@ def handle_message(message, strict: nil)
end

def handle_message_data(message_data, strict: nil)
strict ||= self.strict?
strict = self.strict? if strict.nil?

handler_logger.trace(tags: [:dispatch, :message_data]) { "Dispatching message data (Type: #{message_data.type})" }
handler_logger.trace(tags: [:data, :message_data]) { message_data.pretty_inspect }
Expand Down