Class: FIRM::Serializable::JSON::ObjectHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/firm/serializer/json.rb

Overview

Derived Hash class to use for deserialized JSON object data which supports using Symbol keys.

Instance Method Summary collapse

Methods inherited from Hash

#as_json, json_create

Methods included from ContainerPatch

included

Instance Method Details

#[](key) ⇒ Object

Returns the object associated with given key.

Parameters:

  • key (String, Symbol)

    key value

Returns:

  • (Object)

    associated object

See Also:

  • Hash#[]


39
40
41
# File 'lib/firm/serializer/json.rb', line 39

def [](key)
  super(key.to_s)
end

#include?(key) ⇒ Boolean Also known as: member?, has_key?, key?

Returns true if the given key exists in self otherwise false.

Parameters:

  • key (String, Symbol)

    key value

Returns:

  • (Boolean)

See Also:

  • Hash#include?


46
47
48
# File 'lib/firm/serializer/json.rb', line 46

def include?(key)
  super(key.to_s)
end