Class: ConvenientService::Core::Entities::Config::Entities::MethodMiddlewares::Commands::GenerateStackName
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::Core::Entities::Config::Entities::MethodMiddlewares::Commands::GenerateStackName
- Defined in:
- lib/convenient_service/core/entities/config/entities/method_middlewares/commands/generate_stack_name.rb
Instance Attribute Summary collapse
-
#container ⇒ Object
readonly
Returns the value of attribute container.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Method Summary collapse
- #call ⇒ String
- #formatted_container ⇒ String
- #formatted_method ⇒ String
- #formatted_method_infix ⇒ String
- #formatted_method_suffix ⇒ String
- #formatted_scope ⇒ String
- #initialize(scope:, method:, container:) ⇒ void constructor
Methods inherited from Support::Command
Constructor Details
#initialize(scope:, method:, container:) ⇒ void
40 41 42 43 44 |
# File 'lib/convenient_service/core/entities/config/entities/method_middlewares/commands/generate_stack_name.rb', line 40 def initialize(scope:, method:, container:) @method = method @scope = scope @container = container end |
Instance Attribute Details
#container ⇒ Object (readonly)
Returns the value of attribute container.
32 33 34 |
# File 'lib/convenient_service/core/entities/config/entities/method_middlewares/commands/generate_stack_name.rb', line 32 def container @container end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
26 27 28 |
# File 'lib/convenient_service/core/entities/config/entities/method_middlewares/commands/generate_stack_name.rb', line 26 def method @method end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
20 21 22 |
# File 'lib/convenient_service/core/entities/config/entities/method_middlewares/commands/generate_stack_name.rb', line 20 def scope @scope end |
Instance Method Details
#call ⇒ String
49 50 51 |
# File 'lib/convenient_service/core/entities/config/entities/method_middlewares/commands/generate_stack_name.rb', line 49 def call "#{formatted_container}::MethodMiddlewares::#{formatted_scope}::#{formatted_method}" end |
#formatted_container ⇒ String
56 57 58 |
# File 'lib/convenient_service/core/entities/config/entities/method_middlewares/commands/generate_stack_name.rb', line 56 def formatted_container container.klass end |
#formatted_method ⇒ String
70 71 72 |
# File 'lib/convenient_service/core/entities/config/entities/method_middlewares/commands/generate_stack_name.rb', line 70 def formatted_method "#{formatted_method_infix}#{formatted_method_suffix}" end |
#formatted_method_infix ⇒ String
79 80 81 |
# File 'lib/convenient_service/core/entities/config/entities/method_middlewares/commands/generate_stack_name.rb', line 79 def formatted_method_infix Utils::String.camelize(method) end |
#formatted_method_suffix ⇒ String
86 87 88 89 90 91 92 93 94 |
# File 'lib/convenient_service/core/entities/config/entities/method_middlewares/commands/generate_stack_name.rb', line 86 def formatted_method_suffix if method.end_with?("?") "QuestionMark" elsif method.end_with?("!") "ExclamationMark" else "" end end |