Class: Granted::Granter
- Inherits:
-
Object
- Object
- Granted::Granter
- Defined in:
- lib/granted/granter.rb
Instance Method Summary collapse
- #from(grantee) ⇒ Object
- #grant ⇒ Object
-
#initialize ⇒ Granter
constructor
A new instance of Granter.
- #on(subject) ⇒ Object
- #revoke ⇒ Object
- #right(right) ⇒ Object
- #rights(*rights) ⇒ Object
- #to(grantee) ⇒ Object
Constructor Details
#initialize ⇒ Granter
Returns a new instance of Granter.
3 4 |
# File 'lib/granted/granter.rb', line 3 def initialize end |
Instance Method Details
#from(grantee) ⇒ Object
10 11 12 |
# File 'lib/granted/granter.rb', line 10 def from(grantee) accept(grantee: grantee) end |
#grant ⇒ Object
26 27 28 |
# File 'lib/granted/granter.rb', line 26 def grant accept(action: :grant) end |
#on(subject) ⇒ Object
14 15 16 |
# File 'lib/granted/granter.rb', line 14 def on(subject) accept(subject: subject) end |
#revoke ⇒ Object
30 31 32 |
# File 'lib/granted/granter.rb', line 30 def revoke accept(action: :revoke) end |
#right(right) ⇒ Object
22 23 24 |
# File 'lib/granted/granter.rb', line 22 def right(right) rights(right) end |
#rights(*rights) ⇒ Object
18 19 20 |
# File 'lib/granted/granter.rb', line 18 def rights(*rights) accept(rights: [rights].flatten) end |
#to(grantee) ⇒ Object
6 7 8 |
# File 'lib/granted/granter.rb', line 6 def to(grantee) accept(grantee: grantee) end |