Class: UrlInfoExtractor
- Inherits:
-
Object
- Object
- UrlInfoExtractor
- Includes:
- Favicon
- Defined in:
- lib/url_info_extractor.rb,
lib/url_info_extractor/favicon.rb,
lib/url_info_extractor/version.rb
Defined Under Namespace
Modules: Favicon Classes: SchemeNotSupported
Constant Summary collapse
- VERSION =
"0.0.2"
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(url) ⇒ UrlInfoExtractor
constructor
A new instance of UrlInfoExtractor.
- #scheme_supported? ⇒ Boolean
- #title ⇒ Object
Methods included from Favicon
#favicon_exists?, #favicon_url
Constructor Details
#initialize(url) ⇒ UrlInfoExtractor
Returns a new instance of UrlInfoExtractor.
14 15 16 17 18 |
# File 'lib/url_info_extractor.rb', line 14 def initialize(url) @uri = URI.parse(url) @path = @uri.path @path = '/' if @path.empty? end |
Instance Method Details
#description ⇒ Object
23 24 25 |
# File 'lib/url_info_extractor.rb', line 23 def description fetched_data[:description] end |
#scheme_supported? ⇒ Boolean
27 28 29 |
# File 'lib/url_info_extractor.rb', line 27 def scheme_supported? %w(http https).include? @uri.scheme end |
#title ⇒ Object
19 20 21 |
# File 'lib/url_info_extractor.rb', line 19 def title fetched_data[:title] end |