refactor objects
Some checks failed
Publish Image / publish (push) Waiting to run
Test / build (push) Waiting to run
Build / build (push) Has been cancelled

This commit is contained in:
2024-04-01 17:34:10 -04:00
parent 803f330e82
commit 99f7553d67
15 changed files with 101 additions and 94 deletions

View File

@@ -25,12 +25,12 @@ func (m Module) Inspect() string {
}
func (m Module) Get(index Object) (Object, error) {
key, ok := index.(Hashable)
key, ok := index.(Hasher)
if !ok {
return nil, fmt.Errorf("invalid module attribute %s", index.Type())
}
attr, found := m.Attrs.(*Hash).Pairs[key.HashKey()]
attr, found := m.Attrs.(*Hash).Pairs[key.Hash()]
if !found {
return Null{}, nil
}