Sha256: 56c24330bb366f8b13090320bf1ff526c3e2bdcc407cbd5517659358e770cab6
Contents?: true
Size: 667 Bytes
Versions: 13
Compression:
Stored size: 667 Bytes
Contents
# frozen_string_literal: true require_relative 'hash_informable' module MadFlatter # Provides methods to load and return information about a given hash. module HashLoadable include HashInformable private def load_hash(hash, options) raise ArgumentError, "Argument hash is not a Hash (#{hash.class})" unless hash.is_a? Hash return {} if hash.blank? hash_info = load_hash_info(hash: hash, namespace: options.namespace) return hash_info if options.metadata? strip_metadata(hash_info) end def strip_metadata(hash) hash.transform_values do |metadata| metadata[:value] end end end end
Version data entries
13 entries across 13 versions & 1 rubygems