Class: ConvenientService::Core::Entities::Config::Entities::Concerns::Entities::Middleware::Commands::CastMiddleware

Inherits:
Support::Command
  • Object
show all
Defined in:
lib/convenient_service/core/entities/config/entities/concerns/entities/middleware/commands/cast_middleware.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Support::Command

[], call

Constructor Details

#initialize(other:) ⇒ void



23
24
25
# File 'lib/convenient_service/core/entities/config/entities/concerns/entities/middleware/commands/cast_middleware.rb', line 23

def initialize(other:)
  @other = other
end

Instance Attribute Details

#otherObject (readonly)

Returns the value of attribute other.



17
18
19
# File 'lib/convenient_service/core/entities/config/entities/concerns/entities/middleware/commands/cast_middleware.rb', line 17

def other
  @other
end

Instance Method Details

#callConvenientService::Core::Entities::Config::Entities::Concerns::Entities::Middleware?



30
31
32
33
34
35
36
# File 'lib/convenient_service/core/entities/config/entities/concerns/entities/middleware/commands/cast_middleware.rb', line 30

def call
  if other.instance_of?(::Class) && other < Entities::Middleware
    cast_middleware(other)
  elsif other.instance_of?(::Module)
    cast_module(other)
  end
end