Class: MemoriClient::Client
- Inherits:
-
Object
- Object
- MemoriClient::Client
- Defined in:
- lib/memori_client/client.rb
Instance Attribute Summary collapse
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
-
#version_proxies ⇒ Object
readonly
Returns the value of attribute version_proxies.
Instance Method Summary collapse
-
#initialize(namespace:, kind:, uri:, api_root:) ⇒ Client
constructor
A new instance of Client.
- #load_swagger_spec ⇒ Object
Constructor Details
#initialize(namespace:, kind:, uri:, api_root:) ⇒ Client
Returns a new instance of Client.
6 7 8 9 10 11 12 |
# File 'lib/memori_client/client.rb', line 6 def initialize(namespace:, kind:, uri:, api_root:) @namespace = namespace @kind = kind @uri = uri @api_root = api_root @version_proxies = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object (private)
42 43 44 45 46 47 48 |
# File 'lib/memori_client/client.rb', line 42 def method_missing(method, *args, &block) if @version_proxies.key?(method.to_s) @version_proxies[method.to_s] else super end end |
Instance Attribute Details
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
5 6 7 |
# File 'lib/memori_client/client.rb', line 5 def kind @kind end |
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
4 5 6 |
# File 'lib/memori_client/client.rb', line 4 def namespace @namespace end |
#version_proxies ⇒ Object (readonly)
Returns the value of attribute version_proxies.
3 4 5 |
# File 'lib/memori_client/client.rb', line 3 def version_proxies @version_proxies end |
Instance Method Details
#load_swagger_spec ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/memori_client/client.rb', line 14 def load_swagger_spec if @swagger.nil? @swagger = MemoriClient::Swagger::ProcessSpecification.new(uri: @uri, kind: @kind).call @swagger.each do |key, list| register_resource(key, list) end end end |