Class: Interfacets::Test::ComponentRegistry
- Inherits:
-
Object
- Object
- Interfacets::Test::ComponentRegistry
- Defined in:
- lib/interfacets/test/component_registry.rb
Constant Summary collapse
- DEFAULT_CONFIG_PATH =
"config/interfacets/components.yml"
Instance Attribute Summary collapse
-
#contracts ⇒ Object
readonly
Returns the value of attribute contracts.
Class Method Summary collapse
Instance Method Summary collapse
- #definitions ⇒ Object
- #find_component(name) ⇒ Object
-
#initialize(path) ⇒ ComponentRegistry
constructor
A new instance of ComponentRegistry.
Constructor Details
#initialize(path) ⇒ ComponentRegistry
Returns a new instance of ComponentRegistry.
16 17 18 19 20 |
# File 'lib/interfacets/test/component_registry.rb', line 16 def initialize(path) @path = path @schema_cache = {} @contracts = load_contracts end |
Instance Attribute Details
#contracts ⇒ Object (readonly)
Returns the value of attribute contracts.
14 15 16 |
# File 'lib/interfacets/test/component_registry.rb', line 14 def contracts @contracts end |
Class Method Details
.load(path = DEFAULT_CONFIG_PATH) ⇒ Object
10 11 12 |
# File 'lib/interfacets/test/component_registry.rb', line 10 def self.load(path = DEFAULT_CONFIG_PATH) new(path) end |
Instance Method Details
#definitions ⇒ Object
26 27 28 |
# File 'lib/interfacets/test/component_registry.rb', line 26 def definitions @contracts["definitions"] || {} end |
#find_component(name) ⇒ Object
22 23 24 |
# File 'lib/interfacets/test/component_registry.rb', line 22 def find_component(name) @contracts[name.to_s] end |