Module: CoverMyMeds::Pharmacies

Includes:
HostAndPath
Included in:
Client
Defined in:
lib/covermymeds_api/client/pharmacies.rb

Constant Summary collapse

CURRENT_VERSION =
1

Instance Method Summary collapse

Methods included from HostAndPath

included

Instance Method Details

#get_pharmacy(npi, version = CURRENT_VERSION) ⇒ Object



15
16
17
18
# File 'lib/covermymeds_api/client/pharmacies.rb', line 15

def get_pharmacy npi, version = CURRENT_VERSION
  data = pharmacies_request GET, params: { v: version }, path: npi
  Hashie::Mash.new(data['pharmacy'])
end

#pharmacy_search(params, version = CURRENT_VERSION) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/covermymeds_api/client/pharmacies.rb', line 7

def pharmacy_search params, version=CURRENT_VERSION
  params.merge!(v: version)
  data = pharmacies_request GET, params: params
  data['pharmacies'].map do |d|
    Hashie::Mash.new(d)
  end
end