Class: Usher::Splitter

Inherits:
Object
  • Object
show all
Defined in:
lib/usher/splitter.rb

Defined Under Namespace

Classes: MultiCharacterSplitterInstance, SingleCharacterSplitterInstance

Class Method Summary collapse

Class Method Details

.new(delimiters_array) ⇒ Object



4
5
6
7
8
9
# File 'lib/usher/splitter.rb', line 4

def self.new(delimiters_array)
  delimiters = Delimiters.new(delimiters_array)
  delimiters.any?{|d| d.size > 1} ?
    MultiCharacterSplitterInstance.new(delimiters) :
    SingleCharacterSplitterInstance.new(delimiters)
end