Class: GdsApi::FinderApi
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #get_documents(finder_slug, options = {}) ⇒ Object
- #get_schema(finder_slug, options = {}) ⇒ Object
-
#initialize(url, options = {}) ⇒ FinderApi
constructor
A new instance of FinderApi.
Methods inherited from Base
#client, #create_client, #get_list!, #url_for_slug
Constructor Details
#initialize(url, options = {}) ⇒ FinderApi
Returns a new instance of FinderApi.
6 7 8 9 |
# File 'lib/gds_api/finder_api.rb', line 6 def initialize(url, = {}) @schema_factory = .fetch(:schema_factory) { FinderSchema.method(:new) } super end |
Instance Method Details
#get_documents(finder_slug, options = {}) ⇒ Object
11 12 13 |
# File 'lib/gds_api/finder_api.rb', line 11 def get_documents(finder_slug, = {}) get_json(documents_url(finder_slug, )) end |
#get_schema(finder_slug, options = {}) ⇒ Object
15 16 17 18 19 |
# File 'lib/gds_api/finder_api.rb', line 15 def get_schema(finder_slug, = {}) @schema_factory.call( get_json(finder_url(finder_slug, 'schema', )).to_hash ) end |