Module: Credentials::Extensions::Object
- Defined in:
- lib/credentials/extensions/object.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
-
.included(receiver) ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#can?(*args) ⇒ Boolean
(also: #able_to?)
Returns true if the receiver has access to the specified resource or action.
- #metaclass ⇒ Object
Class Method Details
.included(receiver) ⇒ Object
:nodoc:
65 66 67 |
# File 'lib/credentials/extensions/object.rb', line 65 def self.included(receiver) #:nodoc: receiver.extend ClassMethods end |
Instance Method Details
#can?(*args) ⇒ Boolean Also known as: able_to?
Returns true if the receiver has access to the specified resource or action.
54 55 56 |
# File 'lib/credentials/extensions/object.rb', line 54 def can?(*args) .credentials.allow?(self, *args) end |
#metaclass ⇒ Object
59 60 61 62 63 |
# File 'lib/credentials/extensions/object.rb', line 59 def class << self self end end |