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.


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

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'.


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

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.


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

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.


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

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