class Slosilo::JWT::JSONHash

a hash with a possibly frozen JSON stringification

Public Class Methods

load(raw) click to toggle source
# File lib/slosilo/jwt.rb, line 95
def self.load raw
  self[JSON.load raw.to_s].tap do |h|
    h.send :repr=, raw
  end
end

Public Instance Methods

freeze() click to toggle source
Calls superclass method
# File lib/slosilo/jwt.rb, line 90
def freeze
  @repr = to_json.freeze
  super
end
to_s() click to toggle source
# File lib/slosilo/jwt.rb, line 86
def to_s
  @repr || to_json
end

Private Instance Methods

repr=(raw) click to toggle source
# File lib/slosilo/jwt.rb, line 103
def repr= raw
  @repr = raw.freeze
  freeze
end