Class: AnotherApi::Scopes

Inherits:
Object
  • Object
show all
Defined in:
lib/another_api/scopes.rb

Defined Under Namespace

Classes: DSL

Class Method Summary collapse

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

.registryObject



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

.valuesObject



13
14
15
# File 'lib/another_api/scopes.rb', line 13

def values
  registry.values.map(&:qualified_name)
end