Class: ACL::ACLList

Inherits:
Object
  • Object
show all
Defined in:
lib/drb/acl.rb

Overview

A list of ACLEntry objects. Used to implement the allow and deny halves of an ACL

Instance Method Summary collapse

Constructor Details

#initializeACLList

Creates an empty ACLList



123
124
125
# File 'lib/drb/acl.rb', line 123

def initialize
  @list = []
end

Instance Method Details

#add(str) ⇒ Object

Adds str as an ACLEntry in this list



144
145
146
# File 'lib/drb/acl.rb', line 144

def add(str)
  @list.push(ACLEntry.new(str))
end

#match(addr) ⇒ Object

Matches addr against each ACLEntry in this list.



132
133
134
135
136
137
# File 'lib/drb/acl.rb', line 132

def match(addr)
  @list.each do |e|
    return true if e.match(addr)
  end
  false
end