Class: Mumukit::Auth::Permissions::Change
- Inherits:
-
Object
- Object
- Mumukit::Auth::Permissions::Change
- Defined in:
- lib/mumuki/classroom/permissions_diff.rb
Instance Attribute Summary collapse
-
#grant ⇒ Object
Returns the value of attribute grant.
-
#role ⇒ Object
Returns the value of attribute role.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
- #description ⇒ Object
- #granted_slug ⇒ Object
-
#initialize(role, grant, change_type) ⇒ Change
constructor
A new instance of Change.
- #organization ⇒ Object
Constructor Details
#initialize(role, grant, change_type) ⇒ Change
Returns a new instance of Change.
21 22 23 24 25 |
# File 'lib/mumuki/classroom/permissions_diff.rb', line 21 def initialize(role, grant, change_type) @role = role @grant = grant @type = change_type end |
Instance Attribute Details
#grant ⇒ Object
Returns the value of attribute grant.
19 20 21 |
# File 'lib/mumuki/classroom/permissions_diff.rb', line 19 def grant @grant end |
#role ⇒ Object
Returns the value of attribute role.
19 20 21 |
# File 'lib/mumuki/classroom/permissions_diff.rb', line 19 def role @role end |
#type ⇒ Object
Returns the value of attribute type.
19 20 21 |
# File 'lib/mumuki/classroom/permissions_diff.rb', line 19 def type @type end |
Instance Method Details
#as_json(options = {}) ⇒ Object
39 40 41 |
# File 'lib/mumuki/classroom/permissions_diff.rb', line 39 def as_json( = {}) {role: @role, grant: @grant, type: @type}.as_json end |
#description ⇒ Object
27 28 29 |
# File 'lib/mumuki/classroom/permissions_diff.rb', line 27 def description "#{role}_#{type}" end |
#granted_slug ⇒ Object
35 36 37 |
# File 'lib/mumuki/classroom/permissions_diff.rb', line 35 def granted_slug grant.to_mumukit_slug end |
#organization ⇒ Object
31 32 33 |
# File 'lib/mumuki/classroom/permissions_diff.rb', line 31 def organization granted_slug.organization end |