Class: Sinatra::Jwt::JwkLoader::File
- Defined in:
- lib/sinatra/jwt/jwk_loader.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path = nil) ⇒ File
constructor
A new instance of File.
- #load ⇒ Object
Methods inherited from Loader
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
#path ⇒ Object (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
#load ⇒ Object
33 34 35 |
# File 'lib/sinatra/jwt/jwk_loader.rb', line 33 def load JSON.parse(::File.read(path)) end |