Class: Antech::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(credentials = nil) ⇒ Client

Returns a new instance of Client.



10
11
12
13
14
15
16
17
18
# File 'lib/antech/client.rb', line 10

def initialize(credentials = nil)
  raise ArgumentError.new 'Credentials are required to initialize the client' if credentials.nil?

  [:clinic_id, :username, :password].each do |key|
    raise ArgumentError.new ":#{key} is required to initialize the client" if credentials[key].nil?
  end

  @auth_token = (credentials)
end

Instance Attribute Details

#auth_tokenObject (readonly)

Returns the value of attribute auth_token.



8
9
10
# File 'lib/antech/client.rb', line 8

def auth_token
  @auth_token
end

Instance Method Details

#lab_resultsObject



20
21
22
# File 'lib/antech/client.rb', line 20

def lab_results
  Antech::Resources::LabResult.new(auth_token)
end

#testsObject



24
25
26
# File 'lib/antech/client.rb', line 24

def tests
  Antech::Resources::Test.new(auth_token)
end