Class: GdsApi::Needotron
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#client, #create_client, #get_list!, #initialize, #url_for_slug
Constructor Details
This class inherits a constructor from GdsApi::Base
Instance Method Details
#need_by_id(id, opts = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/gds_api/needotron.rb', line 4 def need_by_id(id, opts = {}) response = get_json("#{base_url}/#{id}.json") return nil if response.nil? or response['need'].nil? if opts[:as_hash] response.to_hash else response.to_ostruct.need end end |