Class: ConvenientService::Utils::String::Split
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::Utils::String::Split
- Defined in:
- lib/convenient_service/utils/string/split.rb
Instance Attribute Summary collapse
-
#delimiters ⇒ Object
readonly
Returns the value of attribute delimiters.
-
#string ⇒ Object
readonly
Returns the value of attribute string.
Instance Method Summary collapse
Methods inherited from Support::Command
Constructor Details
#initialize(string, *delimiters) ⇒ void
24 25 26 27 |
# File 'lib/convenient_service/utils/string/split.rb', line 24 def initialize(string, *delimiters) @string = string.to_s @delimiters = delimiters end |
Instance Attribute Details
#delimiters ⇒ Object (readonly)
Returns the value of attribute delimiters.
17 18 19 |
# File 'lib/convenient_service/utils/string/split.rb', line 17 def delimiters @delimiters end |
#string ⇒ Object (readonly)
Returns the value of attribute string.
11 12 13 |
# File 'lib/convenient_service/utils/string/split.rb', line 11 def string @string end |
Instance Method Details
#call ⇒ String
35 36 37 |
# File 'lib/convenient_service/utils/string/split.rb', line 35 def call string.split(::Regexp.union(delimiters)) end |