Class: WebReader

Inherits:
Object
  • Object
show all
Defined in:
lib/genderstat/web_reader.rb

Instance Method Summary collapse

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

#readObject



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