Sha256: 15f19482025197dbc10dc1a1d325f12f132556f76bf8fe9103c64b62e9280c7b

Contents?: true

Size: 284 Bytes

Versions: 13

Compression:

Stored size: 284 Bytes

Contents

module GovukSchemas
  # @private
  module Utils
    def self.stringify_keys(hash)
      new_hash = {}
      hash.each do |k, v|
        new_hash[k.to_s] = v
      end
      new_hash
    end

    def self.parameterize(string)
      string.gsub(/[^a-z0-9\-_]+/i, '-')
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
govuk_schemas-4.0.0 lib/govuk_schemas/utils.rb
govuk_schemas-3.3.0 lib/govuk_schemas/utils.rb
govuk_schemas-3.2.0 lib/govuk_schemas/utils.rb
govuk_schemas-3.1.0 lib/govuk_schemas/utils.rb
govuk_schemas-3.0.1 lib/govuk_schemas/utils.rb
govuk_schemas-3.0.0 lib/govuk_schemas/utils.rb
govuk_schemas-2.3.0 lib/govuk_schemas/utils.rb
govuk_schemas-2.2.0 lib/govuk_schemas/utils.rb
govuk_schemas-2.1.1 lib/govuk_schemas/utils.rb
govuk_schemas-2.1.0 lib/govuk_schemas/utils.rb
govuk_schemas-2.0.0 lib/govuk_schemas/utils.rb
govuk_schemas-1.0.0 lib/govuk_schemas/utils.rb
govuk_schemas-0.2.0 lib/govuk_schemas/utils.rb