Class: EtFakeCcd::DataStoreService
- Inherits:
-
Object
- Object
- EtFakeCcd::DataStoreService
- Includes:
- Singleton
- Defined in:
- lib/et_fake_ccd/data_store_service.rb
Defined Under Namespace
Classes: InMemoryAdapter
Class Method Summary collapse
- .find_case_data_by_id(id, jid:, ctid:) ⇒ Object
- .list(jid:, ctid:, filters: {}, page: 1, sort_direction: 'asc', page_size: 25) ⇒ Object
- .store_case_data(json, jid:, ctid:) ⇒ Object
- .update_case_data(json, jid:, ctid:, cid:) ⇒ Object
Instance Method Summary collapse
- #adapter ⇒ Object
- #find_case_data_by_id(id, jid:, ctid:) ⇒ Object
- #list(jid:, ctid:, filters: {}, page: 1, sort_direction: 'asc', page_size: 25) ⇒ Object
- #store_case_data(json, jid:, ctid:) ⇒ Object
- #update_case_data(json, jid:, ctid:, cid:) ⇒ Object
Class Method Details
.find_case_data_by_id(id, jid:, ctid:) ⇒ Object
9 10 11 |
# File 'lib/et_fake_ccd/data_store_service.rb', line 9 def self.find_case_data_by_id(id, jid:, ctid:) instance.find_case_data_by_id(id, jid: jid, ctid: ctid) end |
.list(jid:, ctid:, filters: {}, page: 1, sort_direction: 'asc', page_size: 25) ⇒ Object
13 14 15 |
# File 'lib/et_fake_ccd/data_store_service.rb', line 13 def self.list(jid:, ctid:, filters: {}, page: 1, sort_direction: 'asc', page_size: 25) instance.list(jid: jid, ctid: ctid, filters: filters, page: page, sort_direction: sort_direction, page_size: page_size) end |
.store_case_data(json, jid:, ctid:) ⇒ Object
5 6 7 |
# File 'lib/et_fake_ccd/data_store_service.rb', line 5 def self.store_case_data(json, jid:, ctid:) instance.store_case_data(json, jid: jid, ctid: ctid) end |
.update_case_data(json, jid:, ctid:, cid:) ⇒ Object
17 18 19 |
# File 'lib/et_fake_ccd/data_store_service.rb', line 17 def self.update_case_data(json, jid:, ctid:, cid:) instance.update_case_data(json, jid: jid, ctid: ctid, cid: cid) end |
Instance Method Details
#adapter ⇒ Object
37 38 39 |
# File 'lib/et_fake_ccd/data_store_service.rb', line 37 def adapter @adapter ||= InMemoryAdapter.new end |
#find_case_data_by_id(id, jid:, ctid:) ⇒ Object
29 30 31 |
# File 'lib/et_fake_ccd/data_store_service.rb', line 29 def find_case_data_by_id(id, jid:, ctid:) adapter.fetch_by_id(id.to_s, jid: jid, ctid: ctid) end |
#list(jid:, ctid:, filters: {}, page: 1, sort_direction: 'asc', page_size: 25) ⇒ Object
33 34 35 |
# File 'lib/et_fake_ccd/data_store_service.rb', line 33 def list(jid:, ctid:, filters: {}, page: 1, sort_direction: 'asc', page_size: 25) adapter.fetch_all(jid: jid, ctid: ctid, filters: filters, page: page, sort_direction: sort_direction, page_size: page_size) end |
#store_case_data(json, jid:, ctid:) ⇒ Object
21 22 23 |
# File 'lib/et_fake_ccd/data_store_service.rb', line 21 def store_case_data(json, jid:, ctid:) adapter.store(json, jid: jid, ctid: ctid) end |
#update_case_data(json, jid:, ctid:, cid:) ⇒ Object
25 26 27 |
# File 'lib/et_fake_ccd/data_store_service.rb', line 25 def update_case_data(json, jid:, ctid:, cid:) adapter.update_case_data(json, jid: jid, ctid: ctid, cid: cid) end |