Class: Phronomy::CanonicalJSON

Inherits:
Object
  • Object
show all
Defined in:
lib/phronomy/canonical_json.rb

Overview

Phronomy Canonical JSON v1.

v1 accepts JSON-native values only, orders object names by UTF-16 code units, and emits ECMAScript/JCS-compatible number forms for IEEE-754 doubles. Ruby-specific and non-interoperable numeric values must be converted by a domain codec before serialization.

Constant Summary collapse

VERSION =
1
MAX_SAFE_INTEGER =
9_007_199_254_740_991

Class Method Summary collapse

Class Method Details

.dump(value) ⇒ Object



17
18
19
# File 'lib/phronomy/canonical_json.rb', line 17

def dump(value)
  serialize(value)
end

.load(bytes) ⇒ Object



21
22
23
# File 'lib/phronomy/canonical_json.rb', line 21

def load(bytes)
  JSON.parse(bytes)
end