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


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

def initialize
  @list = []
end

Instance Method Details

#add(str) ⇒ Object

Adds str as an ACLEntry in this list


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

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

#match(addr) ⇒ Object

Matches addr against each ACLEntry in this list.


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

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