Module: JSON::JOSE::ClassMethods
- Defined in:
- lib/json/jose.rb
Instance Method Summary collapse
Instance Method Details
#decode(input, key_or_secret = nil) ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/json/jose.rb', line 35 def decode(input, key_or_secret = nil) if input.is_a? Hash decode_json_serialized input, key_or_secret else decode_compact_serialized input, key_or_secret end rescue MultiJson::DecodeError raise JWT::InvalidFormat.new("Invalid JSON Format") end |
#register_header_keys(*keys) ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/json/jose.rb', line 24 def register_header_keys(*keys) keys.each do |header_key| define_method header_key do self.header[header_key] end define_method "#{header_key}=" do |value| self.header[header_key] = value end end end |