Class: ThreeScaleToolbox::CRD::ProductDeploymentParser::AuthenticationParser

Inherits:
Object
  • Object
show all
Defined in:
lib/3scale_toolbox/crds/product_deployment_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#parserObject (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

Returns:

  • (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