lib/convenient_service/support/command.rb in convenient_service-0.16.0 vs lib/convenient_service/support/command.rb in convenient_service-0.17.0
- old
+ new
@@ -6,16 +6,16 @@
# @abstract Subclass and override {#initialize} and {#call} to implement a `Command`.
#
class Command
module Exceptions
class CallIsNotOverridden < ::ConvenientService::Exception
- def initialize(command:)
+ def initialize_with_kwargs(command:)
message = <<~TEXT
Call method (#call) of `#{command.class}` is NOT overridden.
TEXT
- super(message)
+ initialize(message)
end
end
end
class << self
@@ -55,10 +55,10 @@
# @abstract
# @return [Object] Can be any type.
# @raise [ConvenientService::Support::Command::Exceptions::CallIsNotOverridden]
#
def call
- raise Exceptions::CallIsNotOverridden.new(command: self)
+ ::ConvenientService.raise Exceptions::CallIsNotOverridden.new(command: self)
end
end
end
end