Class: SimpleService::ValidatesCommandsNotEmpty

Inherits:
Command
  • Object
show all
Defined in:
lib/simple_service/commands/validates_commands_not_empty.rb

Instance Attribute Summary

Attributes inherited from Command

#context

Instance Method Summary collapse

Methods inherited from Command

#initialize

Methods included from ServiceBase::ClassMethods

#expects, #returns, #skip_validation

Methods included from ServiceBase::InstanceMethods

#all_specified_context_keys, #define_getters_and_setters, #expects, #find_specified_return_keys, #returns, #setup_call_chain, #skip_validation, #symbolize_context_keys

Constructor Details

This class inherits a constructor from SimpleService::Command

Instance Method Details

#callObject



8
9
10
11
12
13
# File 'lib/simple_service/commands/validates_commands_not_empty.rb', line 8

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