Class: LinkPreview::Client
- Inherits:
-
Object
- Object
- LinkPreview::Client
- Defined in:
- lib/link_preview.rb
Instance Method Summary collapse
- #configuration ⇒ Object
- #configure {|configuration| ... } ⇒ Object
- #fetch(uri, options = {}, sources = {}) ⇒ Object
- #load_content(uri, options = {}, sources = {}) ⇒ Object
Instance Method Details
#configuration ⇒ Object
30 31 32 |
# File 'lib/link_preview.rb', line 30 def configuration @configuration ||= LinkPreview::Configuration.new end |
#configure {|configuration| ... } ⇒ Object
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, = {}, sources = {}) LinkPreview::Content.new(configuration, uri, , sources) end |
#load_content(uri, options = {}, sources = {}) ⇒ Object
38 39 40 |
# File 'lib/link_preview.rb', line 38 def load_content(uri, = {}, sources = {}) LinkPreview::Content.new(configuration, uri, .merge(allow_requests: false), sources) end |