Class: URLReader
Instance Method Summary collapse
-
#initialize(url = "") ⇒ URLReader
constructor
A new instance of URLReader.
- #read(url = :default) ⇒ Object
- #source ⇒ Object
Constructor Details
#initialize(url = "") ⇒ URLReader
Returns a new instance of URLReader.
6 7 8 |
# File 'lib/teuton-get/reader/url_reader.rb', line 6 def initialize(url = "") @url = url end |
Instance Method Details
#read(url = :default) ⇒ Object
14 15 16 17 |
# File 'lib/teuton-get/reader/url_reader.rb', line 14 def read(url = :default) @url = url unless url == :default Net::HTTP.get(URI.parse(@url)) end |
#source ⇒ Object
10 11 12 |
# File 'lib/teuton-get/reader/url_reader.rb', line 10 def source @url end |