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.
746 747 748 |
# File 'lib/webrobots/robotstxt.rb', line 746 def delay @delay end |
Instance Method Details
#compile ⇒ Object
734 735 736 737 738 739 740 741 742 743 744 |
# File 'lib/webrobots/robotstxt.rb', line 734 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 |