Class: Access::Privilege
- Inherits:
-
Object
- Object
- Access::Privilege
- Includes:
- Savable
- Defined in:
- lib/access/privilege.rb
Defined Under Namespace
Modules: Base
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#oid ⇒ Object
readonly
Returns the value of attribute oid.
Attributes included from Savable
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(privilege, description = nil) ⇒ Privilege
constructor
A new instance of Privilege.
-
#inspect ⇒ Object
:nodoc:.
- #storable ⇒ Object
Methods included from Savable
Constructor Details
#initialize(privilege, description = nil) ⇒ Privilege
Returns a new instance of Privilege.
41 42 43 44 |
# File 'lib/access/privilege.rb', line 41 def initialize(privilege, description=nil) @oid = privilege @description = description || "No description" end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
39 40 41 |
# File 'lib/access/privilege.rb', line 39 def description @description end |
#oid ⇒ Object (readonly)
Returns the value of attribute oid.
38 39 40 |
# File 'lib/access/privilege.rb', line 38 def oid @oid end |
Instance Method Details
#eql?(other) ⇒ Boolean
53 54 55 |
# File 'lib/access/privilege.rb', line 53 def eql?(other) self.class == other.class && @oid.eql?(other.oid) end |
#hash ⇒ Object
57 58 59 |
# File 'lib/access/privilege.rb', line 57 def hash @oid.hash end |
#inspect ⇒ Object
:nodoc:
61 62 63 64 65 66 67 68 |
# File 'lib/access/privilege.rb', line 61 def inspect # :nodoc: "#<%s:0x%08x oid=%s description=%s>" % [ self.class, object_id << 1, @oid, @description ] end |
#storable ⇒ Object
46 47 48 49 50 51 |
# File 'lib/access/privilege.rb', line 46 def storable { :oid => @oid, :description => @description, } end |