Class: CanLII::Database

Inherits:
Base
  • Object
show all
Defined in:
lib/canlii/database.rb

Class Method Summary collapse

Methods inherited from Base

with_client

Class Method Details

.allObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/canlii/database.rb', line 10

def all
  with_client do |client|
    response = client.get("/caseBrowse/#{language}")
    databases = response["caseDatabases"] || []

    databases.map do |data|
      new(
        database_id: data["databaseId"],
        name: data["name"],
        jurisdiction: data["jurisdiction"]
      )
    end
  end
end