Sha256: 760af9b0a2239739bd250f277ebae36139dfc5af367e1a134f4232171be98570
Contents?: true
Size: 638 Bytes
Versions: 9
Compression:
Stored size: 638 Bytes
Contents
module Render module Extensions class SymbolizableArray < Array class << self def new(array) array.inject(super()) do |accumulator, item| if item.is_a?(Array) accumulator << new(item) elsif item.is_a?(Hash) accumulator << DottableHash.new(item) else accumulator << item end end end end def recursively_symbolize_keys! each do |item| item.recursively_symbolize_keys! if item.respond_to?(:recursively_symbolize_keys!) end self end end end end
Version data entries
9 entries across 9 versions & 1 rubygems