Class: CommandTower::Deserializers::Me::Pushover::CredentialsDeserializer

Inherits:
ApplicationDeserializer show all
Defined in:
app/deserializers/command_tower/deserializers/me/pushover/credentials_deserializer.rb

Defined Under Namespace

Classes: Input

Instance Method Summary collapse

Methods inherited from ApplicationDeserializer

call

Instance Method Details

#call(params) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'app/deserializers/command_tower/deserializers/me/pushover/credentials_deserializer.rb', line 10

def call(params)
  user_key = extract(params, :user_key, :userKey)
  application_token = extract(params, :application_token, :applicationToken)

  if user_key.blank? || application_token.blank?
    return failure(errors: { message: "missing_required_fields" })
  end

  success(Input.new(user_key:, application_token:))
end