Class: Access::Privilege

Inherits:
Object
  • Object
show all
Includes:
Savable
Defined in:
lib/access/privilege.rb

Defined Under Namespace

Modules: Base

Instance Attribute Summary collapse

Attributes included from Savable

#access, #base

Instance Method Summary collapse

Methods included from Savable

#delete, #save

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

#descriptionObject (readonly)

Returns the value of attribute description.



39
40
41
# File 'lib/access/privilege.rb', line 39

def description
  @description
end

#oidObject (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

Returns:

  • (Boolean)


53
54
55
# File 'lib/access/privilege.rb', line 53

def eql?(other)
	self.class == other.class && @oid.eql?(other.oid)
end

#hashObject



57
58
59
# File 'lib/access/privilege.rb', line 57

def hash
	@oid.hash
end

#inspectObject

: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

#storableObject



46
47
48
49
50
51
# File 'lib/access/privilege.rb', line 46

def storable
	{
		:oid         => @oid,
		:description => @description,
	}
end