Sha256: acb2ae233fbc0275f6857b2e86dba4da1d488ae6ed1cf056a13823b297afcda8
Contents?: true
Size: 665 Bytes
Versions: 13
Compression:
Stored size: 665 Bytes
Contents
module SimpleService class Command include ServiceBase::InstanceMethods extend ServiceBase::ClassMethods attr_accessor :context def initialize(context={}) @context = context setup_call_chain define_getters_and_setters unless skip_validation ValidatesExpectedKeys.new(provided_keys: context.keys).call end end # call is where the command's behavior is defined # call should be overriden by whatever class inherits from # this class def call error_msg = "#{self.class} - does not define a call method" raise SimpleService::CallNotDefinedError , error_msg end end end
Version data entries
13 entries across 13 versions & 1 rubygems