Module: Moneta::Utils Private

Extended by:
Utils
Included in:
Utils
Defined in:
lib/moneta/utils.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#to_int(value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



14
15
16
17
18
# File 'lib/moneta/utils.rb', line 14

def to_int(value)
  intvalue = value.to_i
  raise "#{value.inspect} is not an integer value" unless value == nil || intvalue.to_s == value.to_s
  intvalue
end

#without(hash, *keys) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



6
7
8
9
10
11
12
# File 'lib/moneta/utils.rb', line 6

def without(hash, *keys)
  if keys.any? {|k| hash.include?(k) }
    hash = hash.dup
    keys.each {|k| hash.delete(k) }
  end
  hash
end