Class: Flute::Document

Inherits:
Nokogiri::HTML::Document
  • Object
show all
Defined in:
lib/flute/document.rb

Instance Method Summary collapse

Instance Method Details

#descriptionObject



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_descriptionObject



7
8
9
# File 'lib/flute/document.rb', line 7

def og_description
  og('description')
end

#og_imageObject



11
12
13
# File 'lib/flute/document.rb', line 11

def og_image
  og('image')
end

#og_site_nameObject



15
16
17
# File 'lib/flute/document.rb', line 15

def og_site_name
  og('site_name')
end

#og_titleObject



3
4
5
# File 'lib/flute/document.rb', line 3

def og_title
  og('title')
end