Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/terrimporter/string_monkeypatch.rb

Instance Method Summary collapse

Instance Method Details

#robust_splitObject



2
3
4
5
6
7
8
9
10
11
# File 'lib/terrimporter/string_monkeypatch.rb', line 2

def robust_split
  case self
    when /,/
      self.split(/,/).collect(&:strip)
    when /\s/
      self.split(/\s/).collect(&:strip)
    else
      [self.strip]
  end
end