module AuthorizedNetworks

Constants

VERSION

Public Class Methods

config() click to toggle source

Provide a configuration

# File lib/authorized_networks.rb, line 15
def self.config
  @config ||= Config.new
end
configure(&block) click to toggle source

Provide a configuration object to the given block and reteurn the config

@return [AuthorizedNetworks::Config]

# File lib/authorized_networks.rb, line 22
def self.configure(&block)
  block.call(config)
  config
end
instance() click to toggle source

Provide an instance for global use

@return [AuthorizedNetwork::Instance]

# File lib/authorized_networks.rb, line 30
def self.instance
  @instance ||= Instance.new(config)
end
valid_ip!(ip, options = {}) click to toggle source

Is the given IP a valid IP? Raises an error if not

@raises [AuthorizedNetworks::UnauthorizedNetworkError] @return [True]

# File lib/authorized_networks.rb, line 45
def self.valid_ip!(ip, options = {})
  instance.valid_ip!(ip, options)
end
valid_ip?(ip, options = {}) click to toggle source

Is the given IP a valid IP on the global instance?

@return [Boolean]

# File lib/authorized_networks.rb, line 37
def self.valid_ip?(ip, options = {})
  instance.valid_ip?(ip, options)
end