Class: ConvenientService::Commands::IsServiceClass

Inherits:
Support::Command show all
Defined in:
lib/convenient_service/commands/is_service_class.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Support::Command

[], call

Constructor Details

#initialize(service_class:) ⇒ void

Parameters:

  • service_class (Object)

    Can be any type.



16
17
18
# File 'lib/convenient_service/commands/is_service_class.rb', line 16

def initialize(service_class:)
  @service_class = service_class
end

Instance Attribute Details

#service_classObject (readonly)

Returns the value of attribute service_class.



10
11
12
# File 'lib/convenient_service/commands/is_service_class.rb', line 10

def service_class
  @service_class
end

Instance Method Details

#callBoolean

Returns:

  • (Boolean)


23
24
25
26
27
# File 'lib/convenient_service/commands/is_service_class.rb', line 23

def call
  return unless service_class.instance_of?(::Class)

  service_class.include?(Service::Configs::Essential)
end