Module: Pubnub::Validator::Leave
Overview
Validator for Leave event
Instance Method Summary collapse
Methods included from CommonValidator
#validate_origin, #validate_publish_key, #validate_subscribe_key, #validate_user_id
Instance Method Details
#validate! ⇒ Object
9 10 11 12 |
# File 'lib/pubnub/validators/leave.rb', line 9 def validate! return if @skip_validate validate_channel_and_group! end |
#validate_channel_and_group! ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/pubnub/validators/leave.rb', line 14 def validate_channel_and_group! return unless @channel.empty? && @group.empty? && @wildcard_channel.empty? raise( ArgumentError.new( object: self, message: 'You have to specify :channel or :group while using Leave event.' ), 'You have to specify :channel or :group while using Leave event.' ) end |