Class: Bulbasaur::ExtractImagesFromMeta

Inherits:
Object
  • Object
show all
Defined in:
lib/bulbasaur/extracts/extract_images_from_meta.rb

Constant Summary collapse

PROPERTY =
'og:image'

Instance Method Summary collapse

Constructor Details

#initialize(html) ⇒ ExtractImagesFromMeta

Returns a new instance of ExtractImagesFromMeta.



5
6
7
# File 'lib/bulbasaur/extracts/extract_images_from_meta.rb', line 5

def initialize(html)
  @html = html
end

Instance Method Details

#callObject



9
10
11
12
13
# File 'lib/bulbasaur/extracts/extract_images_from_meta.rb', line 9

def call
  meta_informations = Bulbasaur::ExtractMetaInformationsFromHTML.new(@html).call
  image_urls = image_meta_tags(meta_informations).map { |meta| { url: meta[:value], source: 'meta' } }
  image_urls
end