Class: GdsApi::Worldwide

Inherits:
Base
  • Object
show all
Defined in:
lib/gds_api/worldwide.rb

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#client, #create_client, #get_list, #initialize, #url_for_slug

Constructor Details

This class inherits a constructor from GdsApi::Base

Instance Method Details

#organisations_for_world_location(location_slug) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/gds_api/worldwide.rb', line 18

def organisations_for_world_location(location_slug)
  worldwide_organisations = worldwide_organisations_for_location(location_slug)

  worldwide_organisations.map do |organisation|
    worldwide_organisation(organisation["link"])
  end
end

#world_location(location_slug) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/gds_api/worldwide.rb', line 8

def world_location(location_slug)
  world_location = all_world_locations.find do |location|
    location.dig("details", "slug") == location_slug
  end

  raise GdsApi::HTTPNotFound, 404 unless world_location

  world_location
end

#world_locationsObject



4
5
6
# File 'lib/gds_api/worldwide.rb', line 4

def world_locations
  all_world_locations
end