File: snaky_hash.rb

package info (click to toggle)
ruby-snaky-hash 2.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,156 kB
  • sloc: ruby: 1,298; javascript: 529; makefile: 4; sh: 4
file content (42 lines) | stat: -rw-r--r-- 1,035 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# frozen_string_literal: true

# third party gems
require "hashie"
require "version_gem"

require_relative "snaky_hash/version"
require_relative "snaky_hash/extensions"
require_relative "snaky_hash/serializer"
require_relative "snaky_hash/snake"
require_relative "snaky_hash/string_keyed"
require_relative "snaky_hash/symbol_keyed"

# SnakyHash provides hash-like objects with automatic key conversion capabilities
#
# @example Using StringKeyed hash
#   hash = SnakyHash::StringKeyed.new
#   hash["camelCase"] = "value"
#   hash["camel_case"] # => "value"
#
# @example Using SymbolKeyed hash
#   hash = SnakyHash::SymbolKeyed.new
#   hash["camelCase"] = "value"
#   hash[:camel_case] # => "value"
#
# @see SnakyHash::StringKeyed
# @see SnakyHash::SymbolKeyed
# @see SnakyHash::Snake
module SnakyHash
  # Base error class for all SnakyHash errors
  #
  # @api public
  class Error < StandardError
  end
end

# Enable version introspection via VersionGem
#
# @api private
SnakyHash::Version.class_eval do
  extend VersionGem::Basic
end