Class: ChefZero::DataStore::V2ToV1Adapter
- Inherits:
-
InterfaceV1
- Object
- InterfaceV1
- ChefZero::DataStore::V2ToV1Adapter
- Defined in:
- lib/chef_zero/data_store/v2_to_v1_adapter.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#real_store ⇒ Object
readonly
Returns the value of attribute real_store.
-
#single_org ⇒ Object
readonly
Returns the value of attribute single_org.
Instance Method Summary collapse
- #clear ⇒ Object
- #create(path, name, data, *options) ⇒ Object
- #create_dir(path, name, *options) ⇒ Object
- #delete(path) ⇒ Object
- #delete_dir(path, *options) ⇒ Object
- #exists?(path) ⇒ Boolean
- #exists_dir?(path) ⇒ Boolean
- #get(path, request = nil) ⇒ Object
-
#initialize ⇒ V2ToV1Adapter
constructor
A new instance of V2ToV1Adapter.
- #list(path) ⇒ Object
- #set(path, data, *options) ⇒ Object
Methods inherited from InterfaceV1
Constructor Details
#initialize ⇒ V2ToV1Adapter
Returns a new instance of V2ToV1Adapter.
24 25 26 |
# File 'lib/chef_zero/data_store/v2_to_v1_adapter.rb', line 24 def initialize @single_org = "chef" end |
Instance Attribute Details
#real_store ⇒ Object (readonly)
Returns the value of attribute real_store.
28 29 30 |
# File 'lib/chef_zero/data_store/v2_to_v1_adapter.rb', line 28 def real_store @real_store end |
#single_org ⇒ Object (readonly)
Returns the value of attribute single_org.
29 30 31 |
# File 'lib/chef_zero/data_store/v2_to_v1_adapter.rb', line 29 def single_org @single_org end |
Instance Method Details
#clear ⇒ Object
31 32 33 34 |
# File 'lib/chef_zero/data_store/v2_to_v1_adapter.rb', line 31 def clear real_store.clear real_store.create_dir([ "organizations" ], single_org, :recursive) end |
#create(path, name, data, *options) ⇒ Object
42 43 44 45 46 |
# File 'lib/chef_zero/data_store/v2_to_v1_adapter.rb', line 42 def create(path, name, data, *) fix_exceptions do real_store.create(fix_path(path), name, data, *) end end |
#create_dir(path, name, *options) ⇒ Object
36 37 38 39 40 |
# File 'lib/chef_zero/data_store/v2_to_v1_adapter.rb', line 36 def create_dir(path, name, *) fix_exceptions do real_store.create_dir(fix_path(path), name, *) end end |
#delete(path) ⇒ Object
60 61 62 63 64 |
# File 'lib/chef_zero/data_store/v2_to_v1_adapter.rb', line 60 def delete(path) fix_exceptions do real_store.delete(fix_path(path)) end end |
#delete_dir(path, *options) ⇒ Object
66 67 68 69 70 |
# File 'lib/chef_zero/data_store/v2_to_v1_adapter.rb', line 66 def delete_dir(path, *) fix_exceptions do real_store.delete_dir(fix_path(path), *) end end |
#exists?(path) ⇒ Boolean
78 79 80 81 82 |
# File 'lib/chef_zero/data_store/v2_to_v1_adapter.rb', line 78 def exists?(path) fix_exceptions do real_store.exists?(fix_path(path)) end end |
#exists_dir?(path) ⇒ Boolean
84 85 86 87 88 |
# File 'lib/chef_zero/data_store/v2_to_v1_adapter.rb', line 84 def exists_dir?(path) fix_exceptions do real_store.exists_dir?(fix_path(path)) end end |
#get(path, request = nil) ⇒ Object
48 49 50 51 52 |
# File 'lib/chef_zero/data_store/v2_to_v1_adapter.rb', line 48 def get(path, request = nil) fix_exceptions do real_store.get(fix_path(path), request) end end |
#list(path) ⇒ Object
72 73 74 75 76 |
# File 'lib/chef_zero/data_store/v2_to_v1_adapter.rb', line 72 def list(path) fix_exceptions do real_store.list(fix_path(path)) end end |
#set(path, data, *options) ⇒ Object
54 55 56 57 58 |
# File 'lib/chef_zero/data_store/v2_to_v1_adapter.rb', line 54 def set(path, data, *) fix_exceptions do real_store.set(fix_path(path), data, *) end end |