Class: CommandTower::Deserializers::Audit::Events::ShowDeserializer

Inherits:
CommandTower::Deserializers::ApplicationDeserializer show all
Defined in:
app/deserializers/command_tower/deserializers/audit/events.rb

Defined Under Namespace

Classes: Input

Constant Summary collapse

TOOL_ID =
"audit"

Instance Method Summary collapse

Methods inherited from CommandTower::Deserializers::ApplicationDeserializer

call

Instance Method Details

#call(params) ⇒ Object



198
199
200
201
202
203
204
205
206
# File 'app/deserializers/command_tower/deserializers/audit/events.rb', line 198

def call(params)
  id = optional_positive_integer(fetch_param(params, :id).value, field: "id")
  return id if deserializer_result?(id)
  return failure(errors: { message: "invalid_id" }) if id.nil?

  scope_value = CommandTower::Deserializers::Admin::ScopeParameter.extract(params, tool_id: TOOL_ID)

  success(Input.new(id:, scope_value:))
end