Class: Hector::JekyllIdentityAdapter
- Inherits:
-
Object
- Object
- Hector::JekyllIdentityAdapter
- Defined in:
- lib/hector/jekyll_identity_adapter.rb
Instance Attribute Summary collapse
-
#adapters ⇒ Object
Returns the value of attribute adapters.
Instance Method Summary collapse
- #authenticate(username, password) {|authenticated| ... } ⇒ Object
- #forget(username) ⇒ Object
-
#initialize(adapters = []) ⇒ JekyllIdentityAdapter
constructor
A new instance of JekyllIdentityAdapter.
- #normalize(username) ⇒ Object
- #remember(username) ⇒ Object
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
#adapters ⇒ Object
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
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 |