Module: Parse::API::Server

Included in:
Client
Defined in:
lib/parse/api/server.rb

Overview

APIs related to the open source Parse Server.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#server_infoHash

Fetch and cache information about the Parse server configuration. This hash contains information specifically to the configuration of the running parse server.

Returns:

  • (Hash)

    a hash containing server configuration if available.


12
13
14
# File 'lib/parse/api/server.rb', line 12

def server_info
  @server_info
end

Instance Method Details

#server_healthBoolean

Fetches the status of the server based on the health check.

Returns:

  • (Boolean)

    whether the server is 'OK'.


31
32
33
34
35
# File 'lib/parse/api/server.rb', line 31

def server_health
  opts = {cache: false}
  response = request :get, SERVER_HEALTH_PATH, opts: opts
  response.success?
end

#server_info!Hash

Force fetches the server information.

Returns:

  • (Hash)

    a hash containing server configuration if available.


39
40
41
42
# File 'lib/parse/api/server.rb', line 39

def server_info!
  @server_info = nil
  server_info
end

#server_versionString

Returns the version of the Parse server the client is connected to.

Returns:

  • (String)

    a version string (ex. '2.2.25') if available.


46
47
48
# File 'lib/parse/api/server.rb', line 46

def server_version
  server_info.present? ? @server_info[:parseServerVersion] : nil
end