Class: Collapsium::UberHash

Inherits:
Hash
  • Object
show all
Includes:
PathedAccess, PrototypeMatch, RecursiveDup, RecursiveMerge, RecursiveSort, Support::HashMethods, ViralCapabilities
Defined in:
lib/collapsium/uber_hash.rb

Overview

A Hash that includes all the different Hash extensions in collapsium

Constant Summary

Constants included from Support::HashMethods

Support::HashMethods::KEYED_READ_METHODS, Support::HashMethods::KEYED_WRITE_METHODS, Support::HashMethods::READ_METHODS, Support::HashMethods::WRITE_METHODS

Constants included from PrototypeMatch

PrototypeMatch::FAILURE

Constants included from PathedAccess

PathedAccess::DEFAULT_SEPARATOR, PathedAccess::PATHED_ACCESS_READER, PathedAccess::PATHED_ACCESS_WRITER

Instance Method Summary collapse

Methods included from PrototypeMatch

#prototype_match, #prototype_match_score

Methods included from PathedAccess

create_proc, enhance, extended, #filter_components, included, #join_path, #normalize_path, #path_components, #path_prefix, #path_prefix=, prepended, recursive_fetch, #separator, #split_pattern, #virality

Methods included from Support::Methods

loop_detected?, repeated, #resolve_helpers, #wrap_method

Methods included from RecursiveSort

#recursive_sort, #recursive_sort!

Methods included from ViralCapabilities

enhance, enhance_hash_value, extended, #extended, #included, included, prepended, #prepended

Methods included from RecursiveDup

#recursive_dup

Methods included from RecursiveMerge

#recursive_merge, #recursive_merge!

Constructor Details

#initialize(*args) ⇒ UberHash

Returns a new instance of UberHash.



33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/collapsium/uber_hash.rb', line 33

def initialize(*args)
  super

  # Activate IndifferentAccess
  self.default_proc = IndifferentAccess::DEFAULT_PROC

  # Extra functionality: allow being initialized by a Hash
  if args.empty? or not args[0].is_a?(Hash)
    return
  end

  recursive_merge!(args[0])
end