Class: NdsApi::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/nds_api.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ NdsApi::Client

Create a new client instance

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :user (String)

    NDS User

  • :password (String)

    NDS Password

  • :agency_key (String)

    NDS Agency Key



18
19
20
21
22
# File 'lib/nds_api.rb', line 18

def initialize(options = {})
  @options = options.dup
  @http = NdsApi::Http.new(options)
  @url = NdsApi::Url.new(options)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



24
25
26
27
28
29
# File 'lib/nds_api.rb', line 24

def method_missing(method, *args, &block)
  @method = NdsApi::Method.new(method)
  @args = *args
  response = http_action(method, *args, &block)
  NdsApi::Utils.hash_keys_str_to_sym(response)
end