Sha256: f0ae3b5966bd17ccb3832ceb2ef994022608f6156befd172fb6bd62fee3672f1
Contents?: true
Size: 660 Bytes
Versions: 12
Compression:
Stored size: 660 Bytes
Contents
module Kafo module Params class Hash < Param def value=(value) super @value = typecast(@value) end def multivalued? true end def condition_value value.inspect end private def typecast(value) if value.nil? nil elsif value.is_a?(::Hash) value else value = [value].flatten ::Hash[value.map { |v| v.split(':', 2) }] end rescue NoMethodError => e KafoConfigure.logger.warn "Could not typecast #{value} for parameter #{name}, defaulting to {}" return {} end end end end
Version data entries
12 entries across 12 versions & 1 rubygems