Class: Gort::InvalidLine
- Inherits:
-
Object
- Object
- Gort::InvalidLine
- Defined in:
- lib/gort/invalid_line.rb
Overview
Note:
Technically, the RFC doesn’t have invalid lines in its grammar but there are just too many broken robots.txt files on the internet.
Represents an invalid line in a robots.txt file.
An invalid line is a line that can not be parsed as a rule and is not a comment.
Instance Attribute Summary collapse
-
#value ⇒ String
readonly
Content of the line.
Formatting Methods collapse
-
#inspect ⇒ String
A human readable representation of the invalid line.
-
#pretty_print(pp) ⇒ void
Produces a pretty human readable representation of the invalid line.
Instance Method Summary collapse
-
#initialize(text) ⇒ InvalidLine
constructor
A new instance of InvalidLine.
Constructor Details
#initialize(text) ⇒ InvalidLine
Returns a new instance of InvalidLine.
12 13 14 |
# File 'lib/gort/invalid_line.rb', line 12 def initialize(text) @value = text end |
Instance Attribute Details
#value ⇒ String (readonly)
Content of the line.
18 19 20 |
# File 'lib/gort/invalid_line.rb', line 18 def value @value end |
Instance Method Details
#inspect ⇒ String
A human readable representation of the invalid line.
27 28 29 |
# File 'lib/gort/invalid_line.rb', line 27 def inspect %(#<#{self.class.name}:#{object_id} "#{value}">) end |
#pretty_print(pp) ⇒ void
This method returns an undefined value.
Produces a pretty human readable representation of the invalid line.
38 39 40 |
# File 'lib/gort/invalid_line.rb', line 38 def pretty_print(pp) pp.text("#{self.class.name}/#{object_id}< #{value} >") end |