Class: Sus::Registry

Inherits:
Object
  • Object
show all
Defined in:
lib/sus/registry.rb

Constant Summary collapse

DIRECTORY_GLOB =
"**/*.rb"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ Registry

Create a top level scope with self as the instance:



26
27
28
29
# File 'lib/sus/registry.rb', line 26

def initialize(**options)
	@base = Sus.base(self, **options)
	@loaded = {}
end

Instance Attribute Details

#baseObject (readonly)

Returns the value of attribute base.



31
32
33
# File 'lib/sus/registry.rb', line 31

def base
  @base
end

Instance Method Details

#call(assertions = Assertions.default) ⇒ Object



57
58
59
60
61
# File 'lib/sus/registry.rb', line 57

def call(assertions = Assertions.default)
	@base.call(assertions)
	
	return assertions
end

#childrenObject



67
68
69
# File 'lib/sus/registry.rb', line 67

def children
	@base.children
end

#eachObject



63
64
65
# File 'lib/sus/registry.rb', line 63

def each(...)
	@base.each(...)
end

#load(path) ⇒ Object



41
42
43
44
45
46
47
# File 'lib/sus/registry.rb', line 41

def load(path)
	if ::File.directory?(path)
		load_directory(path)
	else
		load_file(path)
	end
end


33
34
35
# File 'lib/sus/registry.rb', line 33

def print(output)
	output.write("Test Registry")
end

#to_sObject



37
38
39
# File 'lib/sus/registry.rb', line 37

def to_s
	@base&.identity&.to_s || self.class.name
end