Module: CommandTower::Messaging::Endpoints::Validators

Defined in:
app/services/command_tower/messaging/endpoints/validators.rb,
app/services/command_tower/messaging/endpoints/validators/push.rb,
app/services/command_tower/messaging/endpoints/validators/pushover.rb

Defined Under Namespace

Modules: Push, Pushover Classes: PushoverCredentialsResult, Result

Class Method Summary collapse

Class Method Details

.for(channel_key) ⇒ Object



17
18
19
20
21
22
23
24
# File 'app/services/command_tower/messaging/endpoints/validators.rb', line 17

def for(channel_key)
  case channel_key.to_s
  when "push" then Push
  when "pushover" then Pushover
  else
    raise ValidationError, "no validator for channel: #{channel_key.inspect}"
  end
end

.validate!(channel_key:, address:) ⇒ Object



26
27
28
# File 'app/services/command_tower/messaging/endpoints/validators.rb', line 26

def validate!(channel_key:, address:)
  self.for(channel_key).validate!(address)
end

.validate_pushover_credentials!(credentials) ⇒ Object



30
31
32
# File 'app/services/command_tower/messaging/endpoints/validators.rb', line 30

def validate_pushover_credentials!(credentials)
  Pushover.validate_credentials!(credentials)
end