Class: RailscastsDownload::PageExplorer
- Inherits:
-
Object
- Object
- RailscastsDownload::PageExplorer
- Defined in:
- lib/railscasts_download/page_explorer.rb
Instance Method Summary collapse
- #get_rss_body ⇒ Object
-
#initialize(options = {}) ⇒ PageExplorer
constructor
A new instance of PageExplorer.
Constructor Details
#initialize(options = {}) ⇒ PageExplorer
Returns a new instance of PageExplorer.
5 6 7 8 9 10 11 12 13 |
# File 'lib/railscasts_download/page_explorer.rb', line 5 def initialize( = {} ) if [:revised] @login_uri = [:login_uri] @login = [:login] @password = [:password] else @free_uri = [:rss_uri] end end |
Instance Method Details
#get_rss_body ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/railscasts_download/page_explorer.rb', line 15 def get_rss_body if @login login_to_pro( @login_uri, @login, @password ) link = get_rss_link @body = link.click.body else @body = open( @free_uri ).read end @body end |