Class: Datadog::AppSec::Contrib::Devise::Resource
- Inherits:
-
Object
- Object
- Datadog::AppSec::Contrib::Devise::Resource
- Defined in:
- lib/datadog/appsec/contrib/devise/resource.rb
Overview
Class to encpasulate extracting information from a Devise resource Normally a devise resource would be an Active::Record instance
Instance Method Summary collapse
- #email ⇒ Object
- #id ⇒ Object
-
#initialize(resource) ⇒ Resource
constructor
A new instance of Resource.
- #username ⇒ Object
Constructor Details
#initialize(resource) ⇒ Resource
Returns a new instance of Resource.
10 11 12 |
# File 'lib/datadog/appsec/contrib/devise/resource.rb', line 10 def initialize(resource) @resource = resource end |
Instance Method Details
#email ⇒ Object
18 19 20 |
# File 'lib/datadog/appsec/contrib/devise/resource.rb', line 18 def email extract(:email) end |
#id ⇒ Object
14 15 16 |
# File 'lib/datadog/appsec/contrib/devise/resource.rb', line 14 def id extract(:id) || extract(:uuid) end |
#username ⇒ Object
22 23 24 |
# File 'lib/datadog/appsec/contrib/devise/resource.rb', line 22 def username extract(:username) end |