Class: ThreeScaleToolbox::CRD::ProductDeploymentParser::AppKeyParser

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

Returns a new instance of AppKeyParser.



84
85
86
87
88
# File 'lib/3scale_toolbox/crds/product_deployment_parser.rb', line 84

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



106
107
108
109
110
111
# File 'lib/3scale_toolbox/crds/product_deployment_parser.rb', line 106

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.



82
83
84
# File 'lib/3scale_toolbox/crds/product_deployment_parser.rb', line 82

def cr
  @cr
end

#gaterway_response_parserObject (readonly)

Returns the value of attribute gaterway_response_parser.



82
83
84
# File 'lib/3scale_toolbox/crds/product_deployment_parser.rb', line 82

def gaterway_response_parser
  @gaterway_response_parser
end

#security_parserObject (readonly)

Returns the value of attribute security_parser.



82
83
84
# File 'lib/3scale_toolbox/crds/product_deployment_parser.rb', line 82

def security_parser
  @security_parser
end

Instance Method Details

#auth_app_idObject



90
91
92
# File 'lib/3scale_toolbox/crds/product_deployment_parser.rb', line 90

def auth_app_id
  cr['appID']
end

#auth_app_keyObject



94
95
96
# File 'lib/3scale_toolbox/crds/product_deployment_parser.rb', line 94

def auth_app_key
  cr['appKey']
end

#backend_versionObject



102
103
104
# File 'lib/3scale_toolbox/crds/product_deployment_parser.rb', line 102

def backend_version
  '2'
end

#credentials_locationObject



98
99
100
# File 'lib/3scale_toolbox/crds/product_deployment_parser.rb', line 98

def credentials_location
  cr['credentials']
end

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

Returns:

  • (Boolean)


113
114
115
# File 'lib/3scale_toolbox/crds/product_deployment_parser.rb', line 113

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