Skip to content

Commit 0473c46

Browse files
author
Philip Müller
authored
Merge pull request #28 from mclark/docs-for-non-default-namespace
add initialization instructions for load path hashes
2 parents ba7fd11 + 479c7db commit 0473c46

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@ resolver = ConstantResolver.new(
3636
)
3737
```
3838

39+
### Default namespaces
40+
41+
If any load paths have a default namespace other than `Object`, these can be specified in a hash:
42+
43+
```ruby
44+
resolver = ConstantResolver.new(
45+
root_path: "/app",
46+
load_paths: {
47+
"/app/models" => "::Object",
48+
"/app/services" => "::Object",
49+
"/app/internal" => "::Business",
50+
}
51+
)
52+
```
53+
3954
### Resolve a constant
4055

4156
Resolve a constant from the contents of your load paths:

0 commit comments

Comments
 (0)