Module: Rack::IpRestrictor

Defined in:
lib/rack_ip_restrictor.rb,
lib/rack_ip_restrictor/config.rb,
lib/rack_ip_restrictor/ip_group.rb,
lib/rack_ip_restrictor/restriction.rb

Overview

namespace IpRestrictor

Defined Under Namespace

Classes: Config, IpGroup, Middleware, Restriction

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configObject (readonly)

Returns the value of attribute config



9
10
11
# File 'lib/rack_ip_restrictor.rb', line 9

def config
  @config
end

Class Method Details

.configure(&block) ⇒ Object



12
13
14
15
# File 'lib/rack_ip_restrictor.rb', line 12

def configure(&block)
  @config = IpRestrictor::Config.new
  @config.instance_eval &block
end

.middlewareMiddleware

Rack middleware

Returns:

  • (Middleware)

    The configured plug & play Rack middleware



19
20
21
# File 'lib/rack_ip_restrictor.rb', line 19

def middleware
  IpRestrictor::Middleware
end