Module: Parse::API::Config

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

Overview

Defines the Config interface for the Parse REST API

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configHash

Return the configuration hash for the configured application for this client. This method caches the configuration after the first time it is fetched.

Returns:

  • (Hash)

    force fetch the application configuration hash.


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

def config
  @config
end

Instance Method Details

#config!Hash

Returns force fetch the application configuration hash.

Returns:

  • (Hash)

    force fetch the application configuration hash.


18
19
20
21
# File 'lib/parse/api/config.rb', line 18

def config!
  @config = nil
  self.config
end

#update_config(params) ⇒ Boolean

Update the application configuration

Parameters:

  • params (Hash)

    the hash of key value pairs.

Returns:

  • (Boolean)

    true if the configuration was successfully updated.


39
40
41
42
43
44
45
46
# File 'lib/parse/api/config.rb', line 39

def update_config(params)
  body = { params: params }
  response = request :put, CONFIG_PATH, body: body
  return false if response.error?
  result = response.result["result"]
  @config.merge!(params) if result && @config.present?
  result
end