Sha256: 6fe0cf61e695620ac3205d5cd43e7a57f4fea0d73b799509ebc3baf7ee20e942

Contents?: true

Size: 407 Bytes

Versions: 11

Compression:

Stored size: 407 Bytes

Contents

module SimpleService
  class ValidatesCommandsNotEmpty < Command

    expects :provided_commands

    skip_validation true # prevent infinite loop

    def call
      if provided_commands.nil? || provided_commands.empty?
        error_msg = 'This Organizer class does not contain any command definitions'
        raise SimpleService::OrganizerCommandsNotDefinedError, error_msg
      end
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
simple_service-1.4.1 lib/simple_service/commands/validates_commands_not_empty.rb
simple_service-1.4.0 lib/simple_service/commands/validates_commands_not_empty.rb
simple_service-1.3.91 lib/simple_service/commands/validates_commands_not_empty.rb
simple_service-1.3.9 lib/simple_service/commands/validates_commands_not_empty.rb
simple_service-1.3.8 lib/simple_service/commands/validates_commands_not_empty.rb
simple_service-1.3.5 lib/simple_service/commands/validates_commands_not_empty.rb
simple_service-1.3.4 lib/simple_service/commands/validates_commands_not_empty.rb
simple_service-1.3.3 lib/simple_service/commands/validates_commands_not_empty.rb
simple_service-1.3.2 lib/simple_service/commands/validates_commands_not_empty.rb
simple_service-1.3.1 lib/simple_service/commands/validates_commands_not_empty.rb
simple_service-1.3.0 lib/simple_service/commands/validates_commands_not_empty.rb