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
35 36 37 38 39 |
# File 'lib/convenient_service/core/entities/config/entities/method_middlewares/commands/generate_stack_name.rb', line 35 def initialize(scope:, method:, container:) @method = method @scope = scope @container = container end |
Instance Attribute Details
#container ⇒ Object (readonly)
Returns the value of attribute container.
27 28 29 |
# File 'lib/convenient_service/core/entities/config/entities/method_middlewares/commands/generate_stack_name.rb', line 27 def container @container end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
21 22 23 |
# File 'lib/convenient_service/core/entities/config/entities/method_middlewares/commands/generate_stack_name.rb', line 21 def method @method end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
15 16 17 |
# File 'lib/convenient_service/core/entities/config/entities/method_middlewares/commands/generate_stack_name.rb', line 15 def scope @scope end |
Instance Method Details
#call ⇒ String
44 45 46 |
# File 'lib/convenient_service/core/entities/config/entities/method_middlewares/commands/generate_stack_name.rb', line 44 def call "#{formatted_container}::MethodMiddlewares::#{formatted_scope}::#{formatted_method}" end |
#formatted_container ⇒ String
51 52 53 |
# File 'lib/convenient_service/core/entities/config/entities/method_middlewares/commands/generate_stack_name.rb', line 51 def formatted_container container.klass end |
#formatted_method ⇒ String
65 66 67 |
# File 'lib/convenient_service/core/entities/config/entities/method_middlewares/commands/generate_stack_name.rb', line 65 def formatted_method "#{formatted_method_infix}#{formatted_method_suffix}" end |
#formatted_method_infix ⇒ String
74 75 76 |
# File 'lib/convenient_service/core/entities/config/entities/method_middlewares/commands/generate_stack_name.rb', line 74 def formatted_method_infix Utils::String.camelize(method) end |
#formatted_method_suffix ⇒ String
81 82 83 84 85 86 87 88 89 |
# File 'lib/convenient_service/core/entities/config/entities/method_middlewares/commands/generate_stack_name.rb', line 81 def formatted_method_suffix if method.end_with?("?") "QuestionMark" elsif method.end_with?("!") "ExclamationMark" else "" end end |