Class: Lighthouse::Facilities::V1::Client

Inherits:
Common::Client::Base show all
Defined in:
lib/lighthouse/facilities/v1/client.rb

Overview

Instance Method Summary collapse

Methods inherited from Common::Client::Base

#config, configuration, #connection, #delete, #get, #perform, #post, #put, #raise_backend_exception, #raise_not_authenticated, #request, #sanitize_headers!, #service_name

Methods included from SentryLogging

#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger, #set_sentry_metadata

Instance Method Details

#get_facilities(params) ⇒ Array<Lighthouse::Facilities::Facility>

Request a list of facilities matching the params provided

Examples:

client.get_facilities(bbox: [60.99, 10.54, 180.00, 20.55])

client.get_facilities(ids: ‘vha_358,vba_358’)

client.get_facilities(lat: 10.54, long: 180.00, per_page: 50, page: 2)

Parameters:

Returns:



24
25
26
27
28
29
# File 'lib/lighthouse/facilities/v1/client.rb', line 24

def get_facilities(params)
  response = perform(:get, '/services/va_facilities/v1/facilities', params)
  facilities = Lighthouse::Facilities::V1::Response.new(response.body, response.status).facilities
  facilities.reject!(&:mobile?) if params['exclude_mobile']
  facilities
end

#get_paginated_facilities(params) ⇒ Object



31
32
33
34
# File 'lib/lighthouse/facilities/v1/client.rb', line 31

def get_paginated_facilities(params)
  response = perform(:get, '/services/va_facilities/v1/facilities', params)
  Lighthouse::Facilities::V1::Response.new(response.body, response.status)
end