Class: WebRobots::RobotsTxt::CrawlDelayLine
- Defined in:
- lib/webrobots/robotstxt.rb
Instance Attribute Summary collapse
-
#delay ⇒ Object
readonly
Returns the value of attribute delay.
Attributes inherited from Line
Instance Method Summary collapse
Methods inherited from Line
Constructor Details
This class inherits a constructor from WebRobots::RobotsTxt::Line
Instance Attribute Details
#delay ⇒ Object (readonly)
Returns the value of attribute delay.
735 736 737 |
# File 'lib/webrobots/robotstxt.rb', line 735 def delay @delay end |
Instance Method Details
#compile ⇒ Object
723 724 725 726 727 728 729 730 731 732 733 |
# File 'lib/webrobots/robotstxt.rb', line 723 def compile case @value when /\A((0|[1-9][0-9]*)\.[0-9]+)/ @delay = @value.to_f when /\A(0|[1-9][0-9]*)/ @delay = @value.to_i else @delay = nil end self end |