class Perseus::CorpusHash

Public Class Methods

new(hash = {}) click to toggle source
Calls superclass method
# File lib/perseus/corpus_hash.rb, line 9
def initialize(hash = {})
  super
  hash.each_pair do |k,v|
    if v.kind_of?(Array)
      self[k] = v.map { |v_i| CorpusHash.new(v_i) }
    elsif v.kind_of?(Hash)
      self[k] = CorpusHash.new v
    else
      self[k] = v
    end
  end
end