Class: ThreeScaleToolbox::CRD::ProductDeploymentParser::UserKeyParser

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) ⇒ UserKeyParser

Returns a new instance of UserKeyParser.



121
122
123
124
125
# File 'lib/3scale_toolbox/crds/product_deployment_parser.rb', line 121

def initialize(cr)
  @cr = cr
  @security_parser = SecurityParser.new(cr.fetch('security', {}))
  @gaterway_response_parser = GatewayResponseParser.new(cr.fetch('gatewayResponse', {}))
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



139
140
141
142
143
144
# File 'lib/3scale_toolbox/crds/product_deployment_parser.rb', line 139

def method_missing(name, *args)
  res = security_parser.public_send(name, *args)
  return res unless res.nil?

  gaterway_response_parser.public_send(name, *args)
end

Instance Attribute Details

#crObject (readonly)

Returns the value of attribute cr.



119
120
121
# File 'lib/3scale_toolbox/crds/product_deployment_parser.rb', line 119

def cr
  @cr
end

#gaterway_response_parserObject (readonly)

Returns the value of attribute gaterway_response_parser.



119
120
121
# File 'lib/3scale_toolbox/crds/product_deployment_parser.rb', line 119

def gaterway_response_parser
  @gaterway_response_parser
end

#security_parserObject (readonly)

Returns the value of attribute security_parser.



119
120
121
# File 'lib/3scale_toolbox/crds/product_deployment_parser.rb', line 119

def security_parser
  @security_parser
end

Instance Method Details

#auth_user_keyObject



131
132
133
# File 'lib/3scale_toolbox/crds/product_deployment_parser.rb', line 131

def auth_user_key
  cr['authUserKey']
end

#backend_versionObject



127
128
129
# File 'lib/3scale_toolbox/crds/product_deployment_parser.rb', line 127

def backend_version
  '1'
end

#credentials_locationObject



135
136
137
# File 'lib/3scale_toolbox/crds/product_deployment_parser.rb', line 135

def credentials_location
  cr['credentials']
end

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


146
147
148
# File 'lib/3scale_toolbox/crds/product_deployment_parser.rb', line 146

def respond_to_missing?(method_name, include_private = false)
  super
end