Class: IpFilter::List
- Inherits:
-
Object
- Object
- IpFilter::List
- Defined in:
- lib/ip_filter/list.rb
Instance Method Summary collapse
- #any?(remote_ip) ⇒ Boolean
-
#initialize(*list) ⇒ List
constructor
A new instance of List.
Constructor Details
#initialize(*list) ⇒ List
Returns a new instance of List.
4 5 6 |
# File 'lib/ip_filter/list.rb', line 4 def initialize(*list) @list = list.flatten.map { |ip| IPAddr.new(ip) } end |
Instance Method Details
#any?(remote_ip) ⇒ Boolean
8 9 10 |
# File 'lib/ip_filter/list.rb', line 8 def any?(remote_ip) @list.any? { |ip| ip.include?(remote_ip) } end |