Sha256: 6e2c341de08d405251bd8da565ff789ba0863757991ff9d06240e29fe62e1bd6

Contents?: true

Size: 297 Bytes

Versions: 2

Compression:

Stored size: 297 Bytes

Contents

require 'sugar-high/kind_of'

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

2 entries across 2 versions & 1 rubygems

Version Path
sugar-high-0.2.2 lib/sugar-high/array.rb
sugar-high-0.2.1 lib/sugar-high/array.rb