Class: Sinatra::Jwt::JwkLoader::File

Inherits:
Loader
  • Object
show all
Defined in:
lib/sinatra/jwt/jwk_loader.rb

Direct Known Subclasses

EnvFile

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Loader

#call

Constructor Details

#initialize(path = nil) ⇒ File

Returns a new instance of File.



28
29
30
31
# File 'lib/sinatra/jwt/jwk_loader.rb', line 28

def initialize(path = nil)
  @path = path || "jwk.json"
  super()
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



26
27
28
# File 'lib/sinatra/jwt/jwk_loader.rb', line 26

def path
  @path
end

Instance Method Details

#loadObject



33
34
35
# File 'lib/sinatra/jwt/jwk_loader.rb', line 33

def load
  JSON.parse(::File.read(path))
end