Sha256: 60cfcd3ec4886f39aaeeec3a192fdabc1e733690ccaf06f4da83964ae7675dea

Contents?: true

Size: 713 Bytes

Versions: 22

Compression:

Stored size: 713 Bytes

Contents

module REXML
  module Node
    include Gibbler::String
  end
end

class Hash
  # A depth-first look to find the deepest point in the Hash. 
  # The top level Hash is counted in the total so the final
  # number is the depth of its children + 1. An example:
  # 
  #     ahash = { :level1 => { :level2 => {} } }
  #     ahash.deepest_point  # => 3
  #
  def deepest_point(h=self, steps=0)
    if h.is_a?(Hash)
      steps += 1
      h.each_pair do |n,possible_h|
        ret = deepest_point(possible_h, steps)
        steps = ret if steps < ret
      end
    else
      return 0
    end
    steps
  end  
end

class Symbol
  unless method_defined? :empty?
    def empty?
      self.to_s.empty?
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
rudy-0.9.8.020 lib/rudy/mixins.rb
rudy-0.9.8.019 lib/rudy/mixins.rb
rudy-0.9.8.018 lib/rudy/mixins.rb
rudy-0.9.8.017 lib/rudy/mixins.rb
rudy-0.9.8.016 lib/rudy/mixins.rb
rudy-0.9.8.015 lib/rudy/mixins.rb
rudy-0.9.8.014 lib/rudy/mixins.rb
rudy-0.9.8.013 lib/rudy/mixins.rb
rudy-0.9.8.012 lib/rudy/mixins.rb
rudy-0.9.8.011 lib/rudy/mixins.rb
rudy-0.9.8.010 lib/rudy/mixins.rb
rudy-0.9.8.009 lib/rudy/mixins.rb
rudy-0.9.8.008 lib/rudy/mixins.rb
rudy-0.9.8.007 lib/rudy/mixins.rb
rudy-0.9.8.006 lib/rudy/mixins.rb
rudy-0.9.8.005 lib/rudy/mixins.rb
rudy-0.9.8.004 lib/rudy/mixins.rb
rudy-0.9.8.003 lib/rudy/mixins.rb
rudy-0.9.8.002 lib/rudy/mixins.rb
rudy-0.9.8.001 lib/rudy/mixins.rb