Class: LinkPreview::Client

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

Instance Method Summary collapse

Instance Method Details

#configurationObject



30
31
32
# File 'lib/link_preview.rb', line 30

def configuration
  @configuration ||= LinkPreview::Configuration.new
end

#configure {|configuration| ... } ⇒ Object

Yields:



26
27
28
# File 'lib/link_preview.rb', line 26

def configure
  yield configuration
end

#fetch(uri, options = {}, sources = {}) ⇒ Object



34
35
36
# File 'lib/link_preview.rb', line 34

def fetch(uri, options = {}, sources = {})
  LinkPreview::Content.new(configuration, uri, options, sources)
end

#load_content(uri, options = {}, sources = {}) ⇒ Object



38
39
40
# File 'lib/link_preview.rb', line 38

def load_content(uri, options = {}, sources = {})
  LinkPreview::Content.new(configuration, uri, options.merge(allow_requests: false), sources)
end