Module: ConfigStore::RecordClientMethods
- Included in:
- Client
- Defined in:
- lib/configstore/clients/record_client_methods.rb
Instance Method Summary collapse
- #create_record(namespace_uuid, record) ⇒ 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) ⇒ Object
Instance Method Details
#create_record(namespace_uuid, record) ⇒ Object
14 15 16 |
# File 'lib/configstore/clients/record_client_methods.rb', line 14 def create_record(namespace_uuid, record) return ConfigStore::Record.from_api_hash(@api.create_record(namespace_uuid, record.to_api_hash)) end |
#delete_record(namespace_uuid, record_key) ⇒ Object
22 23 24 |
# File 'lib/configstore/clients/record_client_methods.rb', line 22 def delete_record(namespace_uuid, record_key) return @api.delete_record(namespace_uuid, record_key) end |
#get_record(namespace_uuid, record_key) ⇒ Object
10 11 12 |
# File 'lib/configstore/clients/record_client_methods.rb', line 10 def get_record(namespace_uuid, record_key) return ConfigStore::Record.from_api_hash(@api.get_record(namespace_uuid, record_key)) end |
#list_records(namespace_uuid) ⇒ Object
4 5 6 7 8 |
# File 'lib/configstore/clients/record_client_methods.rb', line 4 def list_records(namespace_uuid) return @api.list_records(namespace_uuid).map do |raw_record| next(ConfigStore::Record.from_api_hash(raw_record)) end end |
#update_record(namespace_uuid, record_key, record) ⇒ Object
18 19 20 |
# File 'lib/configstore/clients/record_client_methods.rb', line 18 def update_record(namespace_uuid, record_key, record) return ConfigStore::Record.from_api_hash(@api.update_record(namespace_uuid, record_key, record.to_api_hash)) end |