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
25 26 27 |
# File 'lib/convenient_service/service/plugins/has_j_send_result_short_syntax/success/commands/refute_kwargs_contain_j_send_and_extra_keys.rb', line 25 def initialize(kwargs:) @kwargs = kwargs end |
Instance Attribute Details
#kwargs ⇒ Object (readonly)
Returns the value of attribute kwargs.
19 20 21 |
# File 'lib/convenient_service/service/plugins/has_j_send_result_short_syntax/success/commands/refute_kwargs_contain_j_send_and_extra_keys.rb', line 19 def kwargs @kwargs end |
Instance Method Details
#call ⇒ void
This method returns an undefined value.
59 60 61 62 63 64 65 |
# File 'lib/convenient_service/service/plugins/has_j_send_result_short_syntax/success/commands/refute_kwargs_contain_j_send_and_extra_keys.rb', line 59 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 |