Module: Apiphobic::Authorization::Resource::ClassMethods
- Defined in:
- lib/apiphobic/authorization/resource.rb
Instance Method Summary collapse
- #authorized_resource_class ⇒ Object
- #authorized_resource_class_name ⇒ Object
- #authorized_scope_root_class ⇒ Object
- #authorizer_class ⇒ Object
- #authorizer_class_components(type = nil) ⇒ Object
- #authorizer_class_name(type = nil) ⇒ Object
- #authorizer_parameters_class ⇒ Object
- #authorizer_scope_class ⇒ Object
Instance Method Details
#authorized_resource_class ⇒ Object
23 24 25 |
# File 'lib/apiphobic/authorization/resource.rb', line 23 def Object.const_get() end |
#authorized_resource_class_name ⇒ Object
51 52 53 |
# File 'lib/apiphobic/authorization/resource.rb', line 51 def singular_resource_class_name end |
#authorized_scope_root_class ⇒ Object
31 32 33 |
# File 'lib/apiphobic/authorization/resource.rb', line 31 def ||= Object.const_get(singular_resource_class_name) end |
#authorizer_class ⇒ Object
14 15 16 |
# File 'lib/apiphobic/authorization/resource.rb', line 14 def ||= Object.const_get() end |
#authorizer_class_components(type = nil) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/apiphobic/authorization/resource.rb', line 35 def (type = nil) [ name_components['root_module'], 'Authorizers', name_components['submodules'], base_resource_name, type, ] .map(&:to_s) .reject(&:empty?) end |
#authorizer_class_name(type = nil) ⇒ Object
47 48 49 |
# File 'lib/apiphobic/authorization/resource.rb', line 47 def (type = nil) (type).join('::') end |
#authorizer_parameters_class ⇒ Object
18 19 20 21 |
# File 'lib/apiphobic/authorization/resource.rb', line 18 def ||= \ Object.const_get(('Parameters')) end |
#authorizer_scope_class ⇒ Object
27 28 29 |
# File 'lib/apiphobic/authorization/resource.rb', line 27 def ||= Object.const_get(('Scope')) end |