Sha256: 5dee093d56c051b931dd66bb9eae29e54064e6ac7cc0f4f38e0660c27206e397
Contents?: true
Size: 584 Bytes
Versions: 6
Compression:
Stored size: 584 Bytes
Contents
module Moneta # @api private module Utils extend self def without(hash, *keys) return hash if hash.empty? if keys.any? {|k| hash.include?(k) } hash = hash.dup keys.each {|k| hash.delete(k) } end hash end def only(hash, *keys) return hash if hash.empty? ret = {} keys.each {|k| ret[k] = hash[k] } ret end 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 end end
Version data entries
6 entries across 6 versions & 1 rubygems