Class: MyRepresentatives::Commonwealth::WebIndex
- Inherits:
-
Object
- Object
- MyRepresentatives::Commonwealth::WebIndex
- Defined in:
- lib/my_representatives/commonwealth/web_index.rb
Instance Attribute Summary collapse
-
#document ⇒ Object
Returns the value of attribute document.
-
#index_url ⇒ Object
Returns the value of attribute index_url.
-
#member_urls ⇒ Object
Returns the value of attribute member_urls.
-
#senator_urls ⇒ Object
Returns the value of attribute senator_urls.
Instance Method Summary collapse
-
#initialize ⇒ WebIndex
constructor
A new instance of WebIndex.
Constructor Details
#initialize ⇒ WebIndex
Returns a new instance of WebIndex.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/my_representatives/commonwealth/web_index.rb', line 6 def initialize @logger = Logger.new(STDOUT) @index_url = nil @document = nil @member_urls = [] @senator_urls = [] (1..13).each do |page| @index_url = "http://www.aph.gov.au/Senators_and_Members/Parliamentarian_Search_Results?page=#{page}&expand=1&q=&mem=1&par=-1&gen=0&ps=12&st=1" @document = find_representatives representative_urls_from_document( { lower_house: true } ) end (1..7).each do |page| @index_url = "http://www.aph.gov.au/Senators_and_Members/Parliamentarian_Search_Results?page=#{page}&expand=1&q=&sen=1&par=-1&gen=0&ps=12&st=1" @document = find_representatives representative_urls_from_document( { lower_house: false } ) end end |
Instance Attribute Details
#document ⇒ Object
Returns the value of attribute document.
4 5 6 |
# File 'lib/my_representatives/commonwealth/web_index.rb', line 4 def document @document end |
#index_url ⇒ Object
Returns the value of attribute index_url.
4 5 6 |
# File 'lib/my_representatives/commonwealth/web_index.rb', line 4 def index_url @index_url end |
#member_urls ⇒ Object
Returns the value of attribute member_urls.
4 5 6 |
# File 'lib/my_representatives/commonwealth/web_index.rb', line 4 def member_urls @member_urls end |
#senator_urls ⇒ Object
Returns the value of attribute senator_urls.
4 5 6 |
# File 'lib/my_representatives/commonwealth/web_index.rb', line 4 def senator_urls @senator_urls end |