Class: Eaco::Cucumber::ActiveRecord::User::Designators::Authenticated

Inherits:
Designator
  • Object
show all
Defined in:
lib/eaco/cucumber/active_record/user/designators/authenticated.rb

Overview

A Designator based on a the User class.

This is an example on how to grant rights to all instances of a given model.

The class name is available as the Designator#value.

The String representation for an example User is “authenticated:User”.

Instance Attribute Summary

Attributes inherited from Designator

#instance, #value

Instance Method Summary collapse

Methods inherited from Designator

#as_json, configure!, designator_name, harvest, id, #initialize, #inspect, label, #label, make, parse, resolve, search, #type

Constructor Details

This class inherits a constructor from Eaco::Designator

Instance Method Details

#describe ⇒ String

This Designator description.

Returns:

  • (String) —

    an hardcoded description



26
27
28
# File 'lib/eaco/cucumber/active_record/user/designators/authenticated.rb', line 26

def describe(*)
  "Any authenticated user"
end

#klass ⇒ Class (private)

Looks up this class by constantizing it.

Returns:

  • (Class)


45
46
47
# File 'lib/eaco/cucumber/active_record/user/designators/authenticated.rb', line 45

def klass
  @_klass ||= self.value.constantize
end

#resolve ⇒ Array

Users matching this designator.

Returns:

  • (Array) —

    All Users.



35
36
37
# File 'lib/eaco/cucumber/active_record/user/designators/authenticated.rb', line 35

def resolve
  klass.all
end