Class: WebRobots::RobotsTxt::AgentLine

Inherits:
Line
  • Object
show all
Defined in:
lib/webrobots/robotstxt.rb

Instance Attribute Summary collapse

Attributes inherited from Line

#token, #value

Instance Method Summary collapse

Methods inherited from Line

#initialize

Constructor Details

This class inherits a constructor from WebRobots::RobotsTxt::Line

Instance Attribute Details

#patternObject (readonly)

Returns the value of attribute pattern.



672
673
674
# File 'lib/webrobots/robotstxt.rb', line 672

def pattern
  @pattern
end

Instance Method Details

#compileObject



663
664
665
666
667
668
669
670
# File 'lib/webrobots/robotstxt.rb', line 663

def compile
  if @value == '*'
    @pattern = //
  else
    @pattern = Regexp.new(Regexp.quote(@value), Regexp::IGNORECASE)
  end
  self
end