Class: Zookeeper::ACLs::ACL

Inherits:
Object
  • Object
show all
Defined in:
lib/zookeeper/acls.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ ACL


17
18
19
20
21
# File 'lib/zookeeper/acls.rb', line 17

def initialize(hash)
  @perms = hash[:perms]
  v = hash[:id]
  @id = v.kind_of?(Hash) ? Id.new(v) : v
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id


16
17
18
# File 'lib/zookeeper/acls.rb', line 16

def id
  @id
end

#permsObject (readonly)

Returns the value of attribute perms


16
17
18
# File 'lib/zookeeper/acls.rb', line 16

def perms
  @perms
end

Instance Method Details

#to_hashObject


23
24
25
# File 'lib/zookeeper/acls.rb', line 23

def to_hash
  { :perms => perms, :id => id.to_hash }
end