class IpRestriction::IpLoader

Constants

DEFAULT_IPS

Attributes

file_path[R]

Public Class Methods

new(file_path) click to toggle source
# File lib/ip_restriction/ip_loader.rb, line 9
def initialize(file_path)
  @file_path = file_path
end

Public Instance Methods

load() click to toggle source
# File lib/ip_restriction/ip_loader.rb, line 13
def load
  unless File.exist? file_path
    warn "LwIpRestriction: file #{file_path} does not exist"
    return DEFAULT_IPS
  end
  YAML.load_file(file_path)['ips']
end