Class: SimpleImagesDownloader::Line
- Inherits:
-
Object
- Object
- SimpleImagesDownloader::Line
- Defined in:
- lib/simple_images_downloader/line.rb
Overview
Line class Responsible for parsing the string into URI object
Instance Method Summary collapse
-
#initialize(string) ⇒ Line
constructor
A new instance of Line.
-
#uri ⇒ URI
URI object.
Constructor Details
#initialize(string) ⇒ Line
Returns a new instance of Line.
12 13 14 |
# File 'lib/simple_images_downloader/line.rb', line 12 def initialize(string) @string = string end |
Instance Method Details
#uri ⇒ URI
Returns URI object.
20 21 22 23 24 |
# File 'lib/simple_images_downloader/line.rb', line 20 def uri URI.parse(@string) rescue URI::Error raise Errors::BadUrl, @string end |