class Tdc::InMemoryDataDefinition
Knows how to read data definitions from an in-memory representation.
Public Class Methods
new(path_elements_data = {})
click to toggle source
# File lib/tdc/in_memory_data_definition.rb, line 6 def initialize(path_elements_data = {}) @store = path_elements_data end
Public Instance Methods
read(*path_elements)
click to toggle source
# File lib/tdc/in_memory_data_definition.rb, line 10 def read(*path_elements) @store.fetch(path_elements) do raise Tdc::FatalError, "The path did not have any data associated with it: #{path_elements.inspect}" end end
store(path_elements, data)
click to toggle source
# File lib/tdc/in_memory_data_definition.rb, line 16 def store(path_elements, data) @store[path_elements] = data end