Sha256: ba1fafe4874fb91c723f96836b6f4d323ea380f2df42b0666fca608f4d773f83

Contents?: true

Size: 464 Bytes

Versions: 57

Compression:

Stored size: 464 Bytes

Contents

module Waistband
  class StringifiedHash < Hash

    class << self

      def new_from(original)
        copy = new
        original.each do |k, v|
          copy[k] = v
        end
        copy
      end

    end

    def stringify_all
      stringified = {}

      each do |key, val|
        if val.respond_to?(:to_s)
          stringified[key] = val.to_s
        else
          stringified[key] = val
        end
      end

      stringified
    end

  end
end

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
waistband-6.3.0 lib/waistband/stringified_hash.rb
waistband-6.2.0 lib/waistband/stringified_hash.rb
waistband-6.1.1 lib/waistband/stringified_hash.rb
waistband-6.1.0 lib/waistband/stringified_hash.rb
waistband-6.0.0 lib/waistband/stringified_hash.rb
waistband-0.16.7 lib/waistband/stringified_hash.rb
waistband-0.16.6 lib/waistband/stringified_hash.rb
waistband-0.16.5 lib/waistband/stringified_hash.rb
waistband-0.16.3 lib/waistband/stringified_hash.rb
waistband-0.16.2 lib/waistband/stringified_hash.rb
waistband-0.16.1 lib/waistband/stringified_hash.rb
waistband-0.15.2 lib/waistband/stringified_hash.rb
waistband-0.15.1 lib/waistband/stringified_hash.rb
waistband-0.14.3 lib/waistband/stringified_hash.rb
waistband-0.14.2 lib/waistband/stringified_hash.rb
waistband-0.14.1 lib/waistband/stringified_hash.rb
waistband-0.14.0 lib/waistband/stringified_hash.rb
waistband-0.13.0 lib/waistband/stringified_hash.rb
waistband-0.12.2 lib/waistband/stringified_hash.rb
waistband-0.12.1 lib/waistband/stringified_hash.rb