Class: Hash

Inherits:
Object show all
Defined in:
lib/formula_eval/wrapper.rb,
lib/formula_eval/calculating_collection.rb

Instance Method Summary collapse

Instance Method Details

#each_with_str_keyObject



4
5
6
7
8
# File 'lib/formula_eval/calculating_collection.rb', line 4

def each_with_str_key
  each do |k,v|
    yield(k.to_s,v)
  end 
end

#nested_hash_set(*args) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/formula_eval/calculating_collection.rb', line 9

def nested_hash_set(*args)
  args = args.flatten
  KeyParts.with_parts(args[0..-2],:array => true) do |start,lst,mult|
    start.each { |k| self[k] ||= {} }
    self[lst] = args[-1]
  end
end

#to_unwrappedObject



126
127
128
# File 'lib/formula_eval/wrapper.rb', line 126

def to_unwrapped
  map_value { |v| v.to_unwrapped }
end