Module: ConfigStore::RecordAPIMethods
- Included in:
- API
- Defined in:
- lib/configstore/apis/record_api_methods.rb
Instance Method Summary collapse
- #create_record(namespace_uuid, record_hash) ⇒ Object
- #delete_record(namespace_uuid, record_key) ⇒ Object
- #get_record(namespace_uuid, record_key) ⇒ Object
- #list_records(namespace_uuid) ⇒ Object
- #update_record(namespace_uuid, record_key, record_hash) ⇒ Object
Instance Method Details
#create_record(namespace_uuid, record_hash) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/configstore/apis/record_api_methods.rb', line 17 def create_record(namespace_uuid, record_hash) = {body: record_hash.to_json} = .merge(@options) return with_response_handling do self.class.post("/namespaces/#{namespace_uuid}/records", ) end end |
#delete_record(namespace_uuid, record_key) ⇒ Object
33 34 35 36 37 |
# File 'lib/configstore/apis/record_api_methods.rb', line 33 def delete_record(namespace_uuid, record_key) return with_response_handling do self.class.delete("/namespaces/#{namespace_uuid}/records/#{CGI.escape(record_key)}", @options) end end |
#get_record(namespace_uuid, record_key) ⇒ Object
11 12 13 14 15 |
# File 'lib/configstore/apis/record_api_methods.rb', line 11 def get_record(namespace_uuid, record_key) return with_response_handling do self.class.get("/namespaces/#{namespace_uuid}/records/#{CGI.escape(record_key)}", @options) end end |
#list_records(namespace_uuid) ⇒ Object
5 6 7 8 9 |
# File 'lib/configstore/apis/record_api_methods.rb', line 5 def list_records(namespace_uuid) return with_response_handling do self.class.get("/namespaces/#{namespace_uuid}/records", @options) end end |
#update_record(namespace_uuid, record_key, record_hash) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/configstore/apis/record_api_methods.rb', line 25 def update_record(namespace_uuid, record_key, record_hash) = {body: record_hash.to_json} = .merge(@options) return with_response_handling do self.class.put("/namespaces/#{namespace_uuid}/records/#{CGI.escape(record_key)}", ) end end |