Method: Parse::Middleware::Authentication#initialize

Defined in:
lib/parse/client/authentication.rb

#initialize(adapter, options = {}) ⇒ Authentication

Returns a new instance of Authentication.

Parameters:

  • adapter (Faraday::Adapter)

    An instance of the Faraday adapter used for the connection. Defaults Faraday::Adapter::NetHttp.

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

    the options containing Parse authentication data.

Options Hash (options):

  • :application_id (String)

    the application id.

  • :api_key (String)

    the REST API key.

  • :master_key (String)

    the Master Key for this application. If it is set, it will be sent on every request unless this middleware sees DISABLE_MASTER_KEY as an entry in the headers section.

  • :content_type (String)

    the content type format header. Defaults to Protocol::CONTENT_TYPE_FORMAT.



40
41
42
43
44
45
46
# File 'lib/parse/client/authentication.rb', line 40

def initialize(adapter, options = {})
  super(adapter)
  @application_id = options[:application_id]
  @api_key = options[:api_key]
  @master_key = options[:master_key]
  @content_type = options[:content_type] || CONTENT_TYPE_FORMAT
end