Sha256: 627d98e8eb1d3e0ece8493e7b8faf7447542aff3f828affd1eea073f3dc975a8

Contents?: true

Size: 305 Bytes

Versions: 3

Compression:

Stored size: 305 Bytes

Contents

require 'sugar-high/kind_of'

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

  def to_strings option=nil
    self.flatten.select_labels.map(&:to_s)
  end  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sugar-high-0.2.10 lib/sugar-high/array.rb
sugar-high-0.2.9 lib/sugar-high/array.rb
sugar-high-0.2.8 lib/sugar-high/array.rb