Top Level Namespace
Defined Under Namespace
Modules: Datum
Instance Method Summary collapse
-
#__clone(resource, override_hash = nil) ⇒ Hash
From a scenario file, clones the attributes of an existing instance and overrides as specified.
-
#__import(scenario_name) ⇒ void
From a scenario file, imports an existing scenario’s code into the current Binding context of the current scenario.
-
#data_test(name, &block) ⇒ void
Defines a test to work in conjuction with Datum struct extensions found in a file with the same name in the test/datum/data directory.
Instance Method Details
#__clone(resource, override_hash = nil) ⇒ Hash
From a scenario file, clones the attributes of an existing instance and overrides as specified.
40 41 42 |
# File 'lib/support/scenario.rb', line 40 def __clone resource, override_hash = nil ::Datum::Helpers.clone_resource resource, override_hash end |
#__import(scenario_name) ⇒ void
This method returns an undefined value.
From a scenario file, imports an existing scenario’s code into the current Binding context of the current scenario.
23 24 25 |
# File 'lib/support/scenario.rb', line 23 def __import scenario_name ::Datum::Helpers.import_file scenario_name, ::Datum.scenario_path, binding end |
#data_test(name, &block) ⇒ void
This method returns an undefined value.
Defines a test to work in conjuction with Datum struct extensions found in a file with the same name in the test/datum/data directory
76 77 78 79 80 |
# File 'lib/support/test.rb', line 76 def data_test name, &block ::Datum::Container.new(name, self) self.send(:define_method, name, &block) self.class_eval(::Datum::Helpers.read_file(name, ::Datum.data_path)) end |