Class: GovKit::TransparencyDataResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/gov_kit/transparency_data.rb

Instance Attribute Summary

Attributes inherited from Resource

#attributes, #raw_response

Class Method Summary collapse

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

.from_response(response) ⇒ Object

For testing. Instantiate a GovKit::Resource object from sample data To get the sample data, use the text returned by “response.parsed_response” in self.search_for



17
18
19
# File 'lib/gov_kit/transparency_data.rb', line 17

def self.from_response response
  parse response
end

.search_for(path, ops = {}) ⇒ Object



8
9
10
11
12
# File 'lib/gov_kit/transparency_data.rb', line 8

def self.search_for( path, ops={} )
  response = get(path, :query => ops)
  # puts "response.parsed_response: #{response.parsed_response.inspect}"
  parse(response) 
end