Class: CoverMyMeds::Client

Inherits:
Object
  • Object
show all
Includes:
ApiRequest, Credentials, Drugs, Forms, Indicators, Pharmacies, RequestPages, Requests, Tokens
Defined in:
lib/covermymeds_api/client.rb

Constant Summary

Constants included from Indicators

Indicators::CURRENT_VERSION

Constants included from RequestPages

RequestPages::CURRENT_VERSION

Constants included from Credentials

CoverMyMeds::Credentials::CURRENT_VERSION

Constants included from Pharmacies

Pharmacies::CURRENT_VERSION

Constants included from Tokens

Tokens::CURRENT_VERSION

Constants included from Requests

Requests::CURRENT_VERSION

Constants included from Forms

Forms::CURRENT_VERSION

Constants included from Drugs

Drugs::CURRENT_VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Indicators

#post_indicators, #search_indicators

Methods included from HostAndPath

included

Methods included from RequestPages

#get_request_page

Methods included from Credentials

#create_credential, #credentials_path, #delete_credential

Methods included from Pharmacies

#get_pharmacy, #pharmacy_search

Methods included from Tokens

#create_access_token, #revoke_access_token?, #tokens_path

Methods included from Requests

#create_request, #get_request, #get_requests, #request_data

Methods included from Forms

#form_search, #get_form

Methods included from Drugs

#drug_search, #get_drug

Methods included from ApiRequest

#api_uri, #call_api, #request

Constructor Details

#initialize(username, password = nil) {|_self| ... } ⇒ Client

use the block to set module privided instance variables: “‘ruby Client.new(’mark’) do |client|

client.contacts_path = '/'
client.contacts_host = 'http://contacts-api.dev'

end “‘

Defaults are to proudction to make it easy for external gem consumers.

Yields:

  • (_self)

Yield Parameters:



32
33
34
35
36
# File 'lib/covermymeds_api/client.rb', line 32

def initialize(username, password=nil)
  @username = username
  @password = password
  yield(self) if block_given?
end

Instance Attribute Details

#default_hostObject



39
40
41
# File 'lib/covermymeds_api/client.rb', line 39

def default_host
  @default_host ||= "https://api.covermymeds.com"
end