Class: ThreeScaleToolbox::CRD::ProductDeploymentParser::AuthenticationParser
- Inherits:
-
Object
- Object
- ThreeScaleToolbox::CRD::ProductDeploymentParser::AuthenticationParser
- Defined in:
- lib/3scale_toolbox/crds/product_deployment_parser.rb
Instance Attribute Summary collapse
-
#parser ⇒ Object
readonly
Returns the value of attribute parser.
Instance Method Summary collapse
-
#initialize(cr) ⇒ AuthenticationParser
constructor
A new instance of AuthenticationParser.
- #method_missing(name, *args) ⇒ Object
- #respond_to_missing?(method_name, include_private = false) ⇒ Boolean
Constructor Details
#initialize(cr) ⇒ AuthenticationParser
Returns a new instance of AuthenticationParser.
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/3scale_toolbox/crds/product_deployment_parser.rb', line 58 def initialize(cr) @parser = if cr.has_key? 'userkey' UserKeyParser.new(cr.fetch('userkey')) elsif cr.has_key? 'appKeyAppID' AppKeyParser.new(cr.fetch('appKeyAppID')) elsif cr.has_key? 'oidc' OidcParser.new(cr.fetch('oidc')) else raise ThreeScaleToolbox::Error, "Unknown authentication option: #{cr.keys}" end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
71 72 73 |
# File 'lib/3scale_toolbox/crds/product_deployment_parser.rb', line 71 def method_missing(name, *args) parser.public_send(name, *args) end |
Instance Attribute Details
#parser ⇒ Object (readonly)
Returns the value of attribute parser.
56 57 58 |
# File 'lib/3scale_toolbox/crds/product_deployment_parser.rb', line 56 def parser @parser end |
Instance Method Details
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
75 76 77 |
# File 'lib/3scale_toolbox/crds/product_deployment_parser.rb', line 75 def respond_to_missing?(method_name, include_private = false) super end |