Class: ConvenientService::Utils::Method::Name::Append Private
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::Utils::Method::Name::Append
- Defined in:
- lib/convenient_service/utils/method/name/append.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #method_name ⇒ Object readonly private
- #method_suffix ⇒ Object readonly private
Instance Method Summary collapse
- #call ⇒ String private
- #initialize(method_name, method_suffix) ⇒ void constructor private
Methods inherited from Support::Command
Constructor Details
#initialize(method_name, method_suffix) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
30 31 32 33 |
# File 'lib/convenient_service/utils/method/name/append.rb', line 30 def initialize(method_name, method_suffix) @method_name = method_name.to_s @method_suffix = method_suffix.to_s end |
Instance Attribute Details
#method_name ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
17 18 19 |
# File 'lib/convenient_service/utils/method/name/append.rb', line 17 def method_name @method_name end |
#method_suffix ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 |
# File 'lib/convenient_service/utils/method/name/append.rb', line 23 def method_suffix @method_suffix end |
Instance Method Details
#call ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/convenient_service/utils/method/name/append.rb', line 38 def call return "" if method_name.empty? if method_name.end_with?("!") "#{method_name.delete_suffix("!")}#{method_suffix}!" elsif method_name.end_with?("?") "#{method_name.delete_suffix("?")}#{method_suffix}?" else "#{method_name}#{method_suffix}" end end |