Module: SnakyHash

Defined in:
lib/snaky_hash.rb,
lib/snaky_hash/snake.rb,
lib/snaky_hash/version.rb,
lib/snaky_hash/extensions.rb,
lib/snaky_hash/serializer.rb,
lib/snaky_hash/string_keyed.rb,
lib/snaky_hash/symbol_keyed.rb,
sig/snaky_hash.rbs,
sig/snaky_hash/version.rbs

Overview

This is a module-class hybrid.

A flexible key conversion system that supports both String and Symbol keys, with optional serialization capabilities.

Hashie's standard SymbolizeKeys is similar to the functionality we want. ... but not quite. We need to support both String (for oauth2) and Symbol keys (for oauth). see: Hashie::Extensions::Mash::SymbolizeKeys

Examples:

Basic usage with string keys

class MyHash < Hashie::Mash
  include SnakyHash::Snake.new(key_type: :string)
end

Usage with symbol keys and serialization

class MySerializableHash < Hashie::Mash
  include SnakyHash::Snake.new(key_type: :symbol, serializer: true)
end

Defined Under Namespace

Modules: Serializer, Version Classes: Error, Extensions, Snake, StringKeyed, SymbolKeyed

Constant Summary collapse

VERSION =

Traditional Constant Location

Returns:

  • (String)
Version::VERSION