Sha256: 082e443d5fd6764fd01f979253e6e5bd066544c116d8ca72f57c3049133c0729

Contents?: true

Size: 367 Bytes

Versions: 29

Compression:

Stored size: 367 Bytes

Contents

class Lono::Template::Strategy::Dsl::Builder
  module Stringify
    # Accounts for Arrays also. ActiveSupport only works for Hashes.
    def stringify!(data)
      case data
      when Array
        data.map! { |i| stringify!(i) }
      when Hash
        data.deep_transform_keys! { |k| k.to_s }
      else
        data # do not transform
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
lono-7.2.1 lib/lono/template/strategy/dsl/builder/stringify.rb
lono-7.2.0 lib/lono/template/strategy/dsl/builder/stringify.rb
lono-7.1.0 lib/lono/template/strategy/dsl/builder/stringify.rb
lono-7.0.5 lib/lono/template/strategy/dsl/builder/stringify.rb
lono-7.0.4 lib/lono/template/strategy/dsl/builder/stringify.rb
lono-7.0.3 lib/lono/template/strategy/dsl/builder/stringify.rb
lono-7.0.2 lib/lono/template/strategy/dsl/builder/stringify.rb
lono-7.0.1 lib/lono/template/strategy/dsl/builder/stringify.rb
lono-7.0.0 lib/lono/template/strategy/dsl/builder/stringify.rb