Class: RedfishTools::DataStore
- Inherits:
-
Object
- Object
- RedfishTools::DataStore
- Defined in:
- lib/redfish_tools/datastore.rb
Defined Under Namespace
Classes: Resource
Instance Method Summary collapse
- #get(id) ⇒ Object
-
#initialize(base_path) ⇒ DataStore
constructor
A new instance of DataStore.
- #set(id, body, headers: nil, time: nil, parent: nil) ⇒ Object
Constructor Details
#initialize(base_path) ⇒ DataStore
Returns a new instance of DataStore.
9 10 11 12 13 14 15 |
# File 'lib/redfish_tools/datastore.rb', line 9 def initialize(base_path) @base_path = File.(base_path) @overlay = {} root_file = File.join(@base_path, "redfish", "v1", "index.json") raise "Invalid recording folder" unless File.file?(root_file) end |
Instance Method Details
#get(id) ⇒ Object
17 18 19 20 |
# File 'lib/redfish_tools/datastore.rb', line 17 def get(id) id = id.chomp("/") @overlay[id] = @overlay.fetch(id, load_resource(id)) end |