Class: Sus::Registry
- Inherits:
-
Object
- Object
- Sus::Registry
- Defined in:
- lib/sus/registry.rb
Constant Summary collapse
- DIRECTORY_GLOB =
"**/*.rb"
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
Instance Method Summary collapse
- #call(assertions = Assertions.default) ⇒ Object
- #children ⇒ Object
- #each ⇒ Object
-
#initialize(**options) ⇒ Registry
constructor
Create a top level scope with self as the instance:.
- #load(path) ⇒ Object
- #print(output) ⇒ Object
- #to_s ⇒ Object
Constructor Details
Instance Attribute Details
#base ⇒ Object (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 |
#children ⇒ Object
67 68 69 |
# File 'lib/sus/registry.rb', line 67 def children @base.children end |
#each ⇒ Object
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 |
#print(output) ⇒ Object
33 34 35 |
# File 'lib/sus/registry.rb', line 33 def print(output) output.write("Test Registry") end |
#to_s ⇒ Object
37 38 39 |
# File 'lib/sus/registry.rb', line 37 def to_s @base&.identity&.to_s || self.class.name end |