Class: Hector::JekyllIdentityAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/hector/jekyll_identity_adapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(adapters = []) ⇒ JekyllIdentityAdapter

Returns a new instance of JekyllIdentityAdapter.



5
6
7
# File 'lib/hector/jekyll_identity_adapter.rb', line 5

def initialize(adapters = [])
  @adapters = adapters
end

Instance Attribute Details

#adaptersObject

Returns the value of attribute adapters.



3
4
5
# File 'lib/hector/jekyll_identity_adapter.rb', line 3

def adapters
  @adapters
end

Instance Method Details

#authenticate(username, password) {|authenticated| ... } ⇒ Object

Yields:

  • (authenticated)


9
10
11
12
13
14
15
# File 'lib/hector/jekyll_identity_adapter.rb', line 9

def authenticate(username, password)
  authenticated = adapters.any? do |adapter|
    adapter.authenticate(username, password) { |authenticated| authenticated }
  end

  yield authenticated
end

#forget(username) ⇒ Object



17
18
19
# File 'lib/hector/jekyll_identity_adapter.rb', line 17

def forget(username)
  # Do nothing
end

#normalize(username) ⇒ Object



21
22
23
# File 'lib/hector/jekyll_identity_adapter.rb', line 21

def normalize(username)
  username.strip.downcase
end

#remember(username) ⇒ Object



25
26
27
# File 'lib/hector/jekyll_identity_adapter.rb', line 25

def remember(username)
  # Do nothing
end