Sha256: 552f8cc1e59fea730461b75e821b111b277ff98fb1bc25a196a8196dd3357f84
Contents?: true
Size: 494 Bytes
Versions: 49
Compression:
Stored size: 494 Bytes
Contents
module Hamlit module Concerns module AttributeBuilder def flatten_attributes(attributes) flattened = {} attributes.each do |key, value| case value when Hash flatten_attributes(value).each do |k, v| k = k.to_s.gsub(/_/, '-') flattened["#{key}-#{k}"] = v if v end else flattened[key] = value if value end end flattened end end end end
Version data entries
49 entries across 49 versions & 1 rubygems