Sha256: 7250605d6634fe172d5c266e17c44bb84813c46b27d953d42ce70feaa2c93294

Contents?: true

Size: 263 Bytes

Versions: 5

Compression:

Stored size: 263 Bytes

Contents

class Array
  def to_symbols option=nil
    res = self.flatten
    res = case option
    when :num
      res.map{|a| a.kind_of?(Fixnum) ? "_#{a}" : a}
    else      
      res.reject{|a| a.kind_of? Fixnum}
    end    
    res.map(&:to_s).map(&:to_sym)
  end  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sugar-high-0.2.0 lib/sugar-high/array.rb
sugar-high-0.1.8 lib/sugar-high/array.rb
sugar-high-0.1.7 lib/sugar-high/array.rb
sugar-high-0.1.6 lib/sugar-high/array.rb
sugar-high-0.1.5 lib/sugar-high/array.rb