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.
3 4 5 |
# File 'lib/hydra/access_controls/permission.rb', line 3 def initialize(args) @vals = {name: args[:name], access: args[:access], type: args[:type]} end |
Instance Method Details
#==(other) ⇒ Object
35 36 37 |
# File 'lib/hydra/access_controls/permission.rb', line 35 def == other other.is_a?(Permission) && self.name == other.name && self.type == other.type && self.access == other.access end |
#[](var) ⇒ Object
15 16 17 |
# File 'lib/hydra/access_controls/permission.rb', line 15 def [] var to_hash[var] end |
#_destroy ⇒ Object
31 32 33 |
# File 'lib/hydra/access_controls/permission.rb', line 31 def _destroy false end |
#access ⇒ Object
23 24 25 |
# File 'lib/hydra/access_controls/permission.rb', line 23 def access self[:access] end |
#name ⇒ Object
19 20 21 |
# File 'lib/hydra/access_controls/permission.rb', line 19 def name self[:name] end |
#persisted? ⇒ Boolean
7 8 9 |
# File 'lib/hydra/access_controls/permission.rb', line 7 def persisted? false end |
#to_hash ⇒ Object
11 12 13 |
# File 'lib/hydra/access_controls/permission.rb', line 11 def to_hash @vals end |
#type ⇒ Object
27 28 29 |
# File 'lib/hydra/access_controls/permission.rb', line 27 def type self[:type] end |