Class: CoverMyMeds::Client
- Inherits:
-
Object
- Object
- CoverMyMeds::Client
- Includes:
- ApiRequest, Credentials, Drugs, Forms, Indicators, RequestPages, Requests, Tokens
- Defined in:
- lib/cover_my_meds/client.rb
Constant Summary
Constants included from Indicators
Constants included from RequestPages
Constants included from Credentials
CoverMyMeds::Credentials::CURRENT_VERSION
Constants included from Tokens
Constants included from Requests
Constants included from Forms
Constants included from Drugs
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(username, password = nil) {|_self| ... } ⇒ Client
constructor
use the block to set module privided instance variables: “‘ruby Client.new(’mark’) do |client| client.contacts_path = ‘/’ client.contacts_host = ‘contacts-api.dev’ end “‘.
Methods included from Indicators
#post_indicators, #search_indicators
Methods included from HostAndPath
Methods included from RequestPages
Methods included from Credentials
#create_credential, #credentials_path, #delete_credential
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
Methods included from Drugs
Methods included from ApiRequest
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.
30 31 32 33 34 |
# File 'lib/cover_my_meds/client.rb', line 30 def initialize(username, password=nil) @username = username @password = password yield(self) if block_given? end |
Instance Attribute Details
#default_host ⇒ Object
37 38 39 |
# File 'lib/cover_my_meds/client.rb', line 37 def default_host @default_host ||= "https://api.covermymeds.com" end |