Class: ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Code::Commands::IsCode

Inherits:
ConvenientService::Support::Command
  • Object
show all
Defined in:
lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/commands/is_code.rb

Overview

Check whether code can be considered as Code instance.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ConvenientService::Support::Command

[], call

Constructor Details

#initialize(code:) ⇒ void

Parameters:

  • code (Object)

    Can be any type.



28
29
30
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/commands/is_code.rb', line 28

def initialize(code:)
  @code = code
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



22
23
24
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/commands/is_code.rb', line 22

def code
  @code
end

Instance Method Details

#callBoolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/commands/is_code.rb', line 35

def call
  code.class.include?(Entities::Code::Concern)
end