Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
class Foo {
   def propertyMissing(String =name) {String name-> name }
}
def f = new Foo()

assertEquals "boo", f.boo

...

Code Block
class Foo {
   def storage = [:]
   def propertyMissing = {(String name, value->) { storage[name] = value }
   def propertyMissing(String =name) {String name-> storage[name] }
}
def f = new Foo()
f.foo = "bar"

assertEquals "bar", f.foo

...