Class: ConvenientService::Utils::String::Demodulize
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::Utils::String::Demodulize
- Defined in:
- lib/convenient_service/utils/string/demodulize.rb
Overview
Instance Attribute Summary collapse
-
#string ⇒ Object
readonly
Returns the value of attribute string.
Instance Method Summary collapse
- #call ⇒ String
- #initialize(string) ⇒ void constructor
Methods inherited from Support::Command
Constructor Details
#initialize(string) ⇒ void
26 27 28 |
# File 'lib/convenient_service/utils/string/demodulize.rb', line 26 def initialize(string) @string = string.to_s end |
Instance Attribute Details
#string ⇒ Object (readonly)
Returns the value of attribute string.
20 21 22 |
# File 'lib/convenient_service/utils/string/demodulize.rb', line 20 def string @string end |
Instance Method Details
#call ⇒ String
42 43 44 45 46 |
# File 'lib/convenient_service/utils/string/demodulize.rb', line 42 def call i = string.rindex("::") i ? string[(i + 2)..] : string end |