Class: LinkPreview::ExternalFavicon
- Inherits:
-
ExternalImage
- Object
- String
- ExternalResource
- ExternalImage
- LinkPreview::ExternalFavicon
- Defined in:
- lib/link_preview/external_favicon.rb
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
-
#favicon_element ⇒ Object
readonly
Returns the value of attribute favicon_element.
-
#itemprop_element ⇒ Object
readonly
Returns the value of attribute itemprop_element.
-
#open_graph_element ⇒ Object
readonly
Returns the value of attribute open_graph_element.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Attributes inherited from ExternalImage
Instance Method Summary collapse
- #favicon_path ⇒ Object
-
#initialize(uri, document) ⇒ ExternalFavicon
constructor
A new instance of ExternalFavicon.
Methods inherited from ExternalImage
Methods inherited from ExternalResource
Constructor Details
#initialize(uri, document) ⇒ ExternalFavicon
Returns a new instance of ExternalFavicon.
5 6 7 8 9 10 |
# File 'lib/link_preview/external_favicon.rb', line 5 def initialize(uri, document) @uri = uri @document = document super(uri, favicon_path.to_s) end |
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
3 4 5 |
# File 'lib/link_preview/external_favicon.rb', line 3 def document @document end |
#favicon_element ⇒ Object (readonly)
Returns the value of attribute favicon_element.
3 4 5 |
# File 'lib/link_preview/external_favicon.rb', line 3 def favicon_element @favicon_element end |
#itemprop_element ⇒ Object (readonly)
Returns the value of attribute itemprop_element.
3 4 5 |
# File 'lib/link_preview/external_favicon.rb', line 3 def itemprop_element @itemprop_element end |
#open_graph_element ⇒ Object (readonly)
Returns the value of attribute open_graph_element.
3 4 5 |
# File 'lib/link_preview/external_favicon.rb', line 3 def open_graph_element @open_graph_element end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
3 4 5 |
# File 'lib/link_preview/external_favicon.rb', line 3 def uri @uri end |
Instance Method Details
#favicon_path ⇒ Object
12 13 14 |
# File 'lib/link_preview/external_favicon.rb', line 12 def favicon_path find_value(open_graph_element) || favicon_element['href'] || find_value(itemprop_element) end |