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.



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

def config
  @config
end

Instance Method Details

#config!Hash

Returns force fetch the application configuration hash.

Returns:

  • (Hash)

    force fetch the application configuration hash.



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

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.



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

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