Class: NdsApi::Client
- Inherits:
-
Object
- Object
- NdsApi::Client
- Defined in:
- lib/nds_api.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ NdsApi::Client
constructor
Create a new client instance.
- #method_missing(method, *args, &block) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ NdsApi::Client
Create a new client instance
20 21 22 23 24 |
# File 'lib/nds_api.rb', line 20 def initialize( = {}) = .dup @http = NdsApi::Http.new() @url = NdsApi::Url.new() end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/nds_api.rb', line 26 def method_missing(method, *args, &block) @method = NdsApi::Method.new(method) @args = *args validate_search_providers_params! console_debug(step: 1) @response = http_action(method, *args, &block) console_debug(step: 2) NdsApi::Utils.hash_keys_str_to_sym(@response) end |