Class: Passwordless::Resource
- Inherits:
-
Object
- Object
- Passwordless::Resource
- Defined in:
- lib/passwordless/context.rb
Instance Attribute Summary collapse
-
#authenticatable ⇒ Object
readonly
Returns the value of attribute authenticatable.
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
- #defaults ⇒ Object
-
#initialize(resource, controller:) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
#initialize(resource, controller:) ⇒ Resource
Returns a new instance of Resource.
5 6 7 8 9 |
# File 'lib/passwordless/context.rb', line 5 def initialize(resource, controller:) @resource = resource @authenticatable = resource.to_s.singularize.to_sym @controller = controller end |
Instance Attribute Details
#authenticatable ⇒ Object (readonly)
Returns the value of attribute authenticatable.
11 12 13 |
# File 'lib/passwordless/context.rb', line 11 def authenticatable @authenticatable end |
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
11 12 13 |
# File 'lib/passwordless/context.rb', line 11 def controller @controller end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
11 12 13 |
# File 'lib/passwordless/context.rb', line 11 def resource @resource end |
Instance Method Details
#defaults ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/passwordless/context.rb', line 13 def defaults @defaults ||= { authenticatable: authenticatable, resource: resource, controller: controller } end |