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) ⇒ Object
Constructor Details
#initialize(base_path) ⇒ DataStore
Returns a new instance of DataStore.
9 10 11 12 13 |
# File 'lib/redfish_tools/datastore.rb', line 9 def initialize(base_path) # TODO(tadeboro): check for folder and determine mode of operation @base_path = File.(base_path) = {} end |
Instance Method Details
#get(id) ⇒ Object
15 16 17 18 |
# File 'lib/redfish_tools/datastore.rb', line 15 def get(id) id = id.chomp("/") [id] || load_resource(id) end |
#set(id, body, headers: nil, time: nil) ⇒ Object
20 21 22 |
# File 'lib/redfish_tools/datastore.rb', line 20 def set(id, body, headers: nil, time: nil) [id] = Resource.new(id, body, headers, time) end |