Module: Fix::Doc Private
- Defined in:
- lib/fix/doc.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Module for storing and managing specification documents.
This module acts as a registry for specification classes and handles the extraction of test specifications from context objects.
Class Method Summary collapse
-
.extract_specifications(*contexts) ⇒ Array<Array>
private
Extracts test specifications from a list of context classes.
-
.fetch(name) ⇒ Array<Fix::Dsl>
private
Retrieves the contexts array for a named specification.
-
.spec_set(name, klass) ⇒ void
private
Registers a new specification class under the given name.
Class Method Details
.extract_specifications(*contexts) ⇒ Array<Array>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Extracts test specifications from a list of context classes. Each specification consists of an environment and its associated test data.
31 32 33 34 35 |
# File 'lib/fix/doc.rb', line 31 def self.extract_specifications(*contexts) contexts.flat_map do |context| extract_context_specifications(context) end end |
.fetch(name) ⇒ Array<Fix::Dsl>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Retrieves the contexts array for a named specification.
18 19 20 |
# File 'lib/fix/doc.rb', line 18 def self.fetch(name) const_get("#{name}::CONTEXTS") end |
.spec_set(name, klass) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Registers a new specification class under the given name.
43 44 45 46 47 |
# File 'lib/fix/doc.rb', line 43 def self.spec_set(name, klass) const_set(name, klass) rescue ::NameError => _e raise Error::InvalidSpecificationName, name end |