Class: Usher::Splitter::SingleCharacterSplitterInstance
- Inherits:
-
Object
- Object
- Usher::Splitter::SingleCharacterSplitterInstance
- Defined in:
- lib/usher/splitter.rb
Instance Method Summary collapse
-
#initialize(delimiters) ⇒ SingleCharacterSplitterInstance
constructor
A new instance of SingleCharacterSplitterInstance.
- #split(path) ⇒ Object
Constructor Details
#initialize(delimiters) ⇒ SingleCharacterSplitterInstance
Returns a new instance of SingleCharacterSplitterInstance.
13 14 15 |
# File 'lib/usher/splitter.rb', line 13 def initialize(delimiters) @url_split_regex = Regexp.new("[^#{delimiters.regexp_char_class}]+|[#{delimiters.regexp_char_class}]") end |
Instance Method Details
#split(path) ⇒ Object
17 18 19 |
# File 'lib/usher/splitter.rb', line 17 def split(path) path.scan(@url_split_regex) end |