Sha256: 3aa5d9551e79c7c03fa58d8efb0604f0d9f5e459c5777856e049a68f0f8e4e97
Contents?: true
Size: 700 Bytes
Versions: 29
Compression:
Stored size: 700 Bytes
Contents
require 'link_thumbnailer/processor' require 'link_thumbnailer/scraper' module LinkThumbnailer class Page attr_reader :url, :options, :source def initialize(url, options = {}) @url = url @options = options set_options end def generate @source = processor.call(url) scraper.call end def config @config ||= ::LinkThumbnailer.config.dup end private def set_options options.each { |k, v| config.send("#{k}=", v) } end def processor @processor ||= ::LinkThumbnailer::Processor.new end def scraper @scraper ||= ::LinkThumbnailer::Scraper.new(source, processor.url) end end end
Version data entries
29 entries across 29 versions & 1 rubygems