Class: Flute::Document
- Inherits:
-
Nokogiri::HTML::Document
- Object
- Nokogiri::HTML::Document
- Flute::Document
- Defined in:
- lib/flute/document.rb
Instance Method Summary collapse
- #description ⇒ Object
- #og(name) ⇒ Object
- #og_description ⇒ Object
- #og_image ⇒ Object
- #og_site_name ⇒ Object
- #og_title ⇒ Object
Instance Method Details
#description ⇒ Object
19 20 21 |
# File 'lib/flute/document.rb', line 19 def description self.css('meta[name="description"]')&.first&.attr('content')&.strip end |
#og(name) ⇒ Object
23 24 25 |
# File 'lib/flute/document.rb', line 23 def og(name) self.css("meta[property='og:#{name}']")&.first&.attr('content') end |
#og_description ⇒ Object
7 8 9 |
# File 'lib/flute/document.rb', line 7 def og_description og('description') end |
#og_image ⇒ Object
11 12 13 |
# File 'lib/flute/document.rb', line 11 def og_image og('image') end |
#og_site_name ⇒ Object
15 16 17 |
# File 'lib/flute/document.rb', line 15 def og_site_name og('site_name') end |
#og_title ⇒ Object
3 4 5 |
# File 'lib/flute/document.rb', line 3 def og_title og('title') end |