Class: AnotherApi::Scopes
- Inherits:
-
Object
- Object
- AnotherApi::Scopes
- Defined in:
- lib/another_api/scopes.rb
Defined Under Namespace
Classes: DSL
Class Method Summary collapse
- .define(&block) ⇒ Object
- .find(qualified_name) ⇒ Object
- .registry ⇒ Object
- .reset! ⇒ Object
- .values ⇒ Object
Class Method Details
.define(&block) ⇒ Object
4 5 6 7 |
# File 'lib/another_api/scopes.rb', line 4 def define(&block) dsl = DSL.new(self) dsl.instance_eval(&block) end |
.find(qualified_name) ⇒ Object
17 18 19 |
# File 'lib/another_api/scopes.rb', line 17 def find(qualified_name) registry.values.find { |s| s.qualified_name == qualified_name } end |
.registry ⇒ Object
9 10 11 |
# File 'lib/another_api/scopes.rb', line 9 def registry @registry ||= {} end |
.reset! ⇒ Object
21 22 23 |
# File 'lib/another_api/scopes.rb', line 21 def reset! @registry = {} end |
.values ⇒ Object
13 14 15 |
# File 'lib/another_api/scopes.rb', line 13 def values registry.values.map(&:qualified_name) end |