Class: Nokogiri::HTML::Document
- Inherits:
-
Object
- Object
- Nokogiri::HTML::Document
- Defined in:
- lib/webrobots/nokogiri.rb
Instance Method Summary collapse
-
#meta_robots(custom_name = nil) ⇒ Object
Returns an array of lower-cased <meta name=“ROBOTS”> tokens.
-
#nofollow?(custom_name = nil) ⇒ Boolean
Equivalent to meta_robots(custom_name).include?(‘nofollow’).
-
#noindex?(custom_name = nil) ⇒ Boolean
Equivalent to meta_robots(custom_name).include?(‘noindex’).
Instance Method Details
#meta_robots(custom_name = nil) ⇒ Object
Returns an array of lower-cased <meta name=“ROBOTS”> tokens. If no tag is found, returns an empty array. An optional custom_name
specifies the name of a meta tag to look for ahead of “ROBOTS”. Names are compared in a case-insensitive manner.
8 9 10 11 |
# File 'lib/webrobots/nokogiri.rb', line 8 def (custom_name = nil) (@meta_robots ||= {})[custom_name] = (custom_name && (custom_name)) || ('robots') end |
#nofollow?(custom_name = nil) ⇒ Boolean
Equivalent to meta_robots(custom_name).include?(‘nofollow’).
19 20 21 |
# File 'lib/webrobots/nokogiri.rb', line 19 def nofollow?(custom_name = nil) (custom_name).include?('nofollow') end |
#noindex?(custom_name = nil) ⇒ Boolean
Equivalent to meta_robots(custom_name).include?(‘noindex’).
14 15 16 |
# File 'lib/webrobots/nokogiri.rb', line 14 def noindex?(custom_name = nil) (custom_name).include?('noindex') end |