Class: Facebook::Messenger::Configuration::Providers::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/facebook/messenger/configuration/providers/base.rb

Overview

This is the base configuration provider.

User can overwrite this class to customize the environment variables
Be sure to implement all the functions as it raises
NotImplementedError errors.

Direct Known Subclasses

Environment

Instance Method Summary collapse

Instance Method Details

#access_token_forObject

Raises:

  • (NotImplementedError)

28
29
30
# File 'lib/facebook/messenger/configuration/providers/base.rb', line 28

def access_token_for(*)
  raise NotImplementedError
end

#app_secret_forObject

Raises:

  • (NotImplementedError)

24
25
26
# File 'lib/facebook/messenger/configuration/providers/base.rb', line 24

def app_secret_for(*)
  raise NotImplementedError
end

#app_secret_proof_for(page_id = nil) ⇒ Object

A default caching implentation of generating the app_secret_proof for a given page_id


14
15
16
17
18
# File 'lib/facebook/messenger/configuration/providers/base.rb', line 14

def app_secret_proof_for(page_id = nil)
  memo_key = [app_secret_for(page_id), access_token_for(page_id)]
  memoized_app_secret_proofs[memo_key] ||=
    calculate_app_secret_proof(*memo_key)
end

#valid_verify_token?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)

20
21
22
# File 'lib/facebook/messenger/configuration/providers/base.rb', line 20

def valid_verify_token?(*)
  raise NotImplementedError
end