Class: OpenIDConnect::Discovery::Provider::Config::Response
- Inherits:
-
SWD::Resource
- Object
- SWD::Resource
- OpenIDConnect::Discovery::Provider::Config::Response
- Includes:
- AttrOptional
- Defined in:
- lib/openid_connect/discovery/provider/config/response.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#initialize(hash) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(hash) ⇒ Response
Returns a new instance of Response.
33 34 35 36 37 38 39 40 41 |
# File 'lib/openid_connect/discovery/provider/config/response.rb', line 33 def initialize(hash) optional_attributes.each do |key| self.send "#{key}=", hash[key] end @user_info_endpoint ||= hash[:userinfo_endpoint] @user_info_algs_supported ||= hash[:userinfo_algs_supported] @version ||= '3.0' @raw = hash end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
8 9 10 |
# File 'lib/openid_connect/discovery/provider/config/response.rb', line 8 def raw @raw end |
Instance Method Details
#as_json(options = {}) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/openid_connect/discovery/provider/config/response.rb', line 43 def as_json( = {}) hash = optional_attributes.inject({}) do |hash, _attr_| hash.merge( _attr_ => self.send(_attr_) ) end hash[:userinfo_endpoint] = hash.delete(:user_info_endpoint) hash[:userinfo_algs_supported] = hash.delete(:user_info_algs_supported) hash.delete_if do |key, value| value.nil? end end |