Class: ConvenientService::Service::Plugins::HasJSendResultShortSyntax::Success::Commands::RefuteKwargsContainJSendAndExtraKeys
- Inherits:
-
ConvenientService::Support::Command
- Object
- ConvenientService::Support::Command
- ConvenientService::Service::Plugins::HasJSendResultShortSyntax::Success::Commands::RefuteKwargsContainJSendAndExtraKeys
- Defined in:
- lib/convenient_service/service/plugins/has_j_send_result_short_syntax/success/commands/refute_kwargs_contain_j_send_and_extra_keys.rb
Instance Attribute Summary collapse
-
#kwargs ⇒ Object
readonly
Returns the value of attribute kwargs.
Instance Method Summary collapse
- #call ⇒ void
- #initialize(kwargs:) ⇒ void constructor
Methods inherited from ConvenientService::Support::Command
Constructor Details
#initialize(kwargs:) ⇒ void
20 21 22 |
# File 'lib/convenient_service/service/plugins/has_j_send_result_short_syntax/success/commands/refute_kwargs_contain_j_send_and_extra_keys.rb', line 20 def initialize(kwargs:) @kwargs = kwargs end |
Instance Attribute Details
#kwargs ⇒ Object (readonly)
Returns the value of attribute kwargs.
14 15 16 |
# File 'lib/convenient_service/service/plugins/has_j_send_result_short_syntax/success/commands/refute_kwargs_contain_j_send_and_extra_keys.rb', line 14 def kwargs @kwargs end |
Instance Method Details
#call ⇒ void
This method returns an undefined value.
54 55 56 57 58 59 60 |
# File 'lib/convenient_service/service/plugins/has_j_send_result_short_syntax/success/commands/refute_kwargs_contain_j_send_and_extra_keys.rb', line 54 def call return if [:data, :message, :code].none? { |key| kwargs.has_key?(key) } return if kwargs.keys.difference([:data, :message, :code]).none? ::ConvenientService.raise Exceptions::KwargsContainJSendAndExtraKeys.new end |