Sha256: 37a404a9e9ef46be5b5dd29004da3a37157774451bf35342be2069f847947108
Contents?: true
Size: 1.06 KB
Versions: 36
Compression:
Stored size: 1.06 KB
Contents
# Toplevel Pubnub module. module Pubnub # Validator module that holds all validators modules module Validator # Validator for ChannelRegistration event module ChannelRegistration include CommonValidator def validate! return if @skip_validate validate_action! end private def validate_action! validate_action_presence! validate_action_correctness! end def validate_action_presence! return unless @action.nil? raise( ArgumentError.new, ':action is required for channel registration event.' ) end def validate_action_correctness! return if %i[add list_groups get remove list_namespaces].include?(@action.to_sym) raise( ArgumentError.new( object: self, message: 'Invalid :action key. Valid action keys are: :add, :list_groups, :get, :remove key' ), 'Invalid :action key. Valid action keys are: :add, :list_groups, :get, :remove key' ) end end end end
Version data entries
36 entries across 36 versions & 1 rubygems