class MyObject
extend Moon::Memoized
memoize_attr(:name, 'Eggo')
memoize_attr(:age) { 18 }
memoize_attr(:name_length) { name.length }
end
obj = MyObject.new
obj.name #=> Eggo
obj.age #=> 18
obj.name_length #=> 4
-
Notifications
You must be signed in to change notification settings - Fork 1
polyfox/moon-memoized
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Simple implementation of memoized attributes
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published