Class: WebReader
- Inherits:
-
Object
- Object
- WebReader
- Defined in:
- lib/genderstat/web_reader.rb
Instance Method Summary collapse
-
#initialize(url) ⇒ WebReader
constructor
A new instance of WebReader.
- #read ⇒ Object
Constructor Details
#initialize(url) ⇒ WebReader
Returns a new instance of WebReader.
6 7 8 |
# File 'lib/genderstat/web_reader.rb', line 6 def initialize url @url = clean_up_url url end |
Instance Method Details
#read ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/genderstat/web_reader.rb', line 10 def read begin open(@url, :allow_redirections => :safe).read rescue Exception => ex handle_web_exceptions ex end end |