Module: MicrosoftOpenData::Client::Api

Included in:
MicrosoftOpenData::Client
Defined in:
lib/microsoft_open_data/client/api.rb

Instance Method Summary collapse

Instance Method Details

#catalog(container = nil, options = {}) ⇒ Hash

Returns the lists of containers or list of datasets within a specified container

Examples:

catalog('dc')

Parameters:

  • container (String) (defaults to: nil)

    Optional container name

  • options (Hash) (defaults to: {})

    A customizable set of options.

Returns:

  • (Hash)

See Also:



13
14
15
16
17
18
19
# File 'lib/microsoft_open_data/client/api.rb', line 13

def catalog(container=nil, options={})
  if container.nil?
    get("", options)
  else
    get("#{container}", options)
  end
end

#query(container, dataset, options = {}) ⇒ Hash

Returns all the data from a specific dataset

Examples:

query('dc', 'CrimeIncidents')

Parameters:

  • container (String)

    Container name

  • dataset (String)

    Dataset name

  • options (Hash) (defaults to: {})

    A customizable set of options.

Returns:

  • (Hash)

See Also:



30
31
32
# File 'lib/microsoft_open_data/client/api.rb', line 30

def query(container, dataset, options={})
  get("#{container}/#{dataset}", options)
end