Class: LinkThumbnailer::Page

Inherits:
Object
  • Object
show all
Defined in:
lib/link_thumbnailer/page.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, options = {}) ⇒ Page

Returns a new instance of Page.



9
10
11
12
13
14
# File 'lib/link_thumbnailer/page.rb', line 9

def initialize(url, options = {})
  @url     = url
  @options = options

  set_options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



7
8
9
# File 'lib/link_thumbnailer/page.rb', line 7

def options
  @options
end

#sourceObject (readonly)

Returns the value of attribute source.



7
8
9
# File 'lib/link_thumbnailer/page.rb', line 7

def source
  @source
end

#urlObject (readonly)

Returns the value of attribute url.



7
8
9
# File 'lib/link_thumbnailer/page.rb', line 7

def url
  @url
end

Instance Method Details

#configObject



21
22
23
# File 'lib/link_thumbnailer/page.rb', line 21

def config
  @config ||= ::LinkThumbnailer.config.dup
end

#generateObject



16
17
18
19
# File 'lib/link_thumbnailer/page.rb', line 16

def generate
  @source = processor.call(url)
  scraper.call
end