Sha256: 2211cdce1199afc048103254625805cb50bb3a17ea9d8f70418ab9d6454922ea

Contents?: true

Size: 347 Bytes

Versions: 7

Compression:

Stored size: 347 Bytes

Contents

class Array

  def to_list
    self
  end

end

class NilClass

  def to_list
    []
  end

end

class String

  # Helper method for cleaning list options.
  # This will split the option on ':' or ';'
  # if it is a string, rather than an array.
  # And it will make sure there are no nil elements.

  def to_list
    split(/[:;,\n]/)
  end

end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
detroit-0.4.0 lib/detroit/core_ext/to_list.rb
detroit-0.3.0 lib/detroit/tool/core_ext/to_list.rb
detroit-0.2.0 lib/detroit/tool/core_ext/to_list.rb
detroit-0.1.0 lib/detroit/tool/core_ext/to_list.rb
ratch-1.2.0 lib/ratch/core_ext/to_list.rb
ratch-1.1.0 lib/ratch/core_ext/to_list.rb
ratch-1.0.0 lib/ratch/core_ext/to_list.rb