Module: Credentials::Extensions::Object

Defined in:
lib/credentials/extensions/object.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(receiver) ⇒ Object

:nodoc:



59
60
61
# File 'lib/credentials/extensions/object.rb', line 59

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.

Returns:

  • (Boolean)


54
55
56
# File 'lib/credentials/extensions/object.rb', line 54

def can?(*args)
  self.class.credentials.allow? self, *args
end