Sha256: 608881f56b23457311eae0f87092d9aaa06f348716a4122c39d464cceededc77
Contents?: true
Size: 817 Bytes
Versions: 9
Compression:
Stored size: 817 Bytes
Contents
# Copyright (c) 2015 Sqreen. All Rights Reserved. # Please refer to our terms for more information: https://www.sqreen.com/terms.html require 'sqreen/actions/ip_ranges_index' module Sqreen module Actions module IpRangeIndexedActionClass include IpRangesIndex def actions_matching(client_ip) matching_actions client_ip end def index(params, action) ranges = parse_ip_ranges params ranges.each do |r| add_prefix r, action end end private # returns array of prefixes in string form def parse_ip_ranges(params) ranges = params['ip_cidr'] unless ranges && ranges.is_a?(Array) && !ranges.empty? raise 'no non-empty ip_cidr array present' end ranges end end end end
Version data entries
9 entries across 9 versions & 1 rubygems