Class: Hector::ExpressionEngineIdentityAdapter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename = nil) ⇒ ExpressionEngineIdentityAdapter

Returns a new instance of ExpressionEngineIdentityAdapter.



17
18
19
20
21
# File 'lib/hector/ee_identity_adapter.rb', line 17

def initialize(filename = nil)
  @filename = filename || Hector.root.join("config/expression_engine.yml")
  load_config
  load_database
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



15
16
17
# File 'lib/hector/ee_identity_adapter.rb', line 15

def config
  @config
end

#databaseObject (readonly)

Returns the value of attribute database.



15
16
17
# File 'lib/hector/ee_identity_adapter.rb', line 15

def database
  @database
end

#filenameObject (readonly)

Returns the value of attribute filename.



15
16
17
# File 'lib/hector/ee_identity_adapter.rb', line 15

def filename
  @filename
end

Instance Method Details

#authenticate(username, password) {|normalize(identity(normalize(username))) == normalize(password)| ... } ⇒ Object

Yields:

  • (normalize(identity(normalize(username))) == normalize(password))


23
24
25
26
# File 'lib/hector/ee_identity_adapter.rb', line 23

def authenticate(username, password)
  load_config
  yield normalize(identity(normalize(username))) == normalize(password)
end

#forget(username) ⇒ Object



33
34
35
36
# File 'lib/hector/ee_identity_adapter.rb', line 33

def forget(username)
  Hector.logger.warn "Hector cannot manage ExpressionEngine members"
  false
end

#remember(username, password) ⇒ Object



28
29
30
31
# File 'lib/hector/ee_identity_adapter.rb', line 28

def remember(username, password)
  Hector.logger.warn "Hector cannot manage ExpressionEngine members"
  false
end