Class: HipTail::MemoryAuthorityProvider

Inherits:
AuthorityProvider show all
Defined in:
lib/hiptail/authority/provider.rb

Instance Method Summary collapse

Methods inherited from AuthorityProvider

#[], #[]=

Constructor Details

#initializeHipTail::MemoryAuthorityProvider



42
43
44
# File 'lib/hiptail/authority/provider.rb', line 42

def initialize
  @authorities = {}
end

Instance Method Details

#get(oauth_id) ⇒ HipTail::Authority

Parameters:

  • oauth_id (String)

Returns:



48
49
50
# File 'lib/hiptail/authority/provider.rb', line 48

def get(oauth_id)
  @authorities[oauth_id]
end

#register(oauth_id, authority) ⇒ HipTail::Authority

Parameters:

Returns:



55
56
57
# File 'lib/hiptail/authority/provider.rb', line 55

def register(oauth_id, authority)
  @authorities[oauth_id] = authority
end

#unregister(oauth_id) ⇒ void

This method returns an undefined value.

Parameters:

  • oauth_id (String)


61
62
63
# File 'lib/hiptail/authority/provider.rb', line 61

def unregister(oauth_id)
  @authorities.delete(oauth_id)
end