Skip to content

Macro::Semantic

Vladislav Trotsenko edited this page Oct 21, 2020 · 1 revision

Synopsis

Provides to set value of semantic marker (semantic_success or semantic_failure) into context. Semantic uses for handling http statuses into ApplicationEndpoint.

Examples of usage

Setting semantic success

class SomeOperation < ApplicationOperation
  step Macro::Semantic(success: :ok) # ctx[:semantic_success] = :ok
end

Setting semantic failure

class SomeOperation < ApplicationOperation
  fail Macro::Semantic(failure: :not_found) # ctx[:semantic_failure] = :not_found
end

Clone this wiki locally