Class: GovKit::FollowTheMoney::Business
- Inherits:
-
GovKit::FollowTheMoneyResource
- Object
- Resource
- GovKit::FollowTheMoneyResource
- GovKit::FollowTheMoney::Business
- Defined in:
- lib/gov_kit/follow_the_money.rb
Overview
Wrap Industry data
Instance Attribute Summary
Attributes inherited from Resource
Class Method Summary collapse
-
.list ⇒ Business
Return a list of all business, industry, and sector categories.
Methods inherited from GovKit::FollowTheMoneyResource
Methods inherited from Resource
#initialize, instantiate, instantiate_collection, parse, #to_md5, #unload
Constructor Details
This class inherits a constructor from GovKit::Resource
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class GovKit::Resource
Class Method Details
.list ⇒ Business
Return a list of all business, industry, and sector categories. See the FollowTheMoney API.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/gov_kit/follow_the_money.rb', line 64 def self.list next_page, result, page_num = "yes", [], 0 until next_page != "yes" # puts "Getting batch number #{page_num}" doc = get_xml("/base_level.industries.list.php", :query => {:page => page_num}) next_page = doc.children.first.attributes['next_page'].value page_num += 1 result += doc.search('//business_detail').collect { |x| x.attributes } end stringify_values_of(result) parse(result) end |