Sha256: b6a7c29da32df24ef40b2061138f7f455c524aab9663d58a309e47a54e4f0080

Contents?: true

Size: 280 Bytes

Versions: 5

Compression:

Stored size: 280 Bytes

Contents

class Array
  def present_join(in_delim=", ")
    self.select {|x| (x || '').strip != ""}.join(in_delim)
  end
  
  def hashify_single(in_sym=nil)
    res = {}
    self.each do |iter_el|
      res[in_sym.nil? ? iter_el : iter_el.send(in_sym)] = iter_el
    end
    res
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mwk-ruby-utils-0.5.0 lib/mwk-ruby-utils.rb
mwk-ruby-utils-0.4.0 lib/mwk-ruby-utils.rb
mwk-ruby-utils-0.3.1 lib/mwk-ruby-utils.rb
mwk-ruby-utils-0.3.0 lib/mwk-ruby-utils.rb
mwk-ruby-utils-0.2.0 lib/mwk-ruby-utils.rb