Sha256: 2001b2188255cd8a145315e6dca4b79d6cdaa7d2000fdb05a5e916e5ba206600

Contents?: true

Size: 861 Bytes

Versions: 1

Compression:

Stored size: 861 Bytes

Contents

module ErrandBoy
  module Validator
    class SlackInvite < Base
      def check_register_name
        warn 'register_name is empty.' if @request.register['name'].empty?
      rescue NoMethodError
        raise InvalidError, 'register does not set.'
      end

      def check_register_email
        email = @request.register['email']
        if email.empty?
          raise InvalidError, 'register_email is empty.'
        elsif email !~ valid_address
          raise InvalidError, 'register_email is invalid address.'
        end
      rescue NoMethodError
        raise InvalidError, 'register does not set.'
      end

      def check_team
        if @request.destination['team'].empty?
          raise InvalidError, 'team is empty.'
        end
      rescue NoMethodError
        raise InvalidError, 'destination does not set.'
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
errand-boy-0.1.0 lib/errand_boy/validator/slack_invite.rb