Daisuke Maki
and 1 contributors

NAME

Gungho::Component::RobotRules::Rule - A Rule Object

SYNOPSIS

  use Gungho::Component::RobotRules::Rule;
  my $rule = Gungho::Component::RobotRules::Rule->new(
    'UserAgent A' => [ '/foo', '/bar' ],
    'UserAgent B' => [ '/baz', '/quux' ],
  );

DESCRIPTION

This modules stores the RobotRules ruleset for a particular host.

METHODS

new

Creates a new rule. A single rule is a set of subrules that represents an user-agent to a list of denied paths.

No host information is stored.

setup

Initializes the rule.

allowed($c, $uri)

Returns true if the given URL is allowed within this ruleset

is_me($c,$string)

Returns true if $string matches our user agent string contained in $c->user_agent