Class: Hydra::AccessControls::Permission
- Inherits:
-
Object
- Object
- Hydra::AccessControls::Permission
- Defined in:
- lib/hydra/access_controls/permission.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
- #[](var) ⇒ Object
- #_destroy ⇒ Object
- #access ⇒ Object
-
#initialize(args) ⇒ Permission
constructor
A new instance of Permission.
- #name ⇒ Object
- #persisted? ⇒ Boolean
- #to_hash ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(args) ⇒ Permission
Returns a new instance of Permission.
4 5 6 |
# File 'lib/hydra/access_controls/permission.rb', line 4 def initialize(args) @vals = {name: args[:name], access: args[:access], type: args[:type]} end |
Instance Method Details
#==(other) ⇒ Object
36 37 38 |
# File 'lib/hydra/access_controls/permission.rb', line 36 def == other other.is_a?(Permission) && self.name == other.name && self.type == other.type && self.access == other.access end |
#[](var) ⇒ Object
16 17 18 |
# File 'lib/hydra/access_controls/permission.rb', line 16 def [] var to_hash[var] end |
#_destroy ⇒ Object
32 33 34 |
# File 'lib/hydra/access_controls/permission.rb', line 32 def _destroy false end |
#access ⇒ Object
24 25 26 |
# File 'lib/hydra/access_controls/permission.rb', line 24 def access self[:access] end |
#name ⇒ Object
20 21 22 |
# File 'lib/hydra/access_controls/permission.rb', line 20 def name self[:name] end |
#persisted? ⇒ Boolean
8 9 10 |
# File 'lib/hydra/access_controls/permission.rb', line 8 def persisted? false end |
#to_hash ⇒ Object
12 13 14 |
# File 'lib/hydra/access_controls/permission.rb', line 12 def to_hash @vals end |
#type ⇒ Object
28 29 30 |
# File 'lib/hydra/access_controls/permission.rb', line 28 def type self[:type] end |