Class: URLReader

Inherits:
Reader show all
Defined in:
lib/teuton-get/reader/url_reader.rb

Instance Method Summary collapse

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

#sourceObject



10
11
12
# File 'lib/teuton-get/reader/url_reader.rb', line 10

def source
  @url
end