Sha256: c9ae9e9320e361475f5cd2acc61772f6ba7fa488f0572ac673b7477b7779110b

Contents?: true

Size: 328 Bytes

Versions: 1

Compression:

Stored size: 328 Bytes

Contents

module Sloth
  module ArrayHelpers
    def cleanup
      flatten.compact.uniq.reject(&:empty?)
    end

    def substring_search string_pattern
      pattern = Regexp.new(string_pattern.to_s)
      result = []
      self.each do |element|
        result << element if element =~ pattern
      end
      result
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sloth-rb-0.1.0 lib/sloth/array_helpers.rb