Is it possibly to dynamically set the class of an expando??
Having set
jr = new Expando()
Is there a way to
def end = 'name'
so that
jr.end
will actually give me the value stored in
jr.name
Is it possibly to dynamically set the class of an expando??
Having set
jr = new Expando()
Is there a way to
def end = 'name'
so that
jr.end
will actually give me the value stored in
jr.name
I'm not sure I understand your question, maybe this will help
jr = new Expando()
jr.end = 'name'
jr.name = jr.end
assert jr.end == jr.name
assert jr.end == 'name'
fixed it, need to assign a value at the same time. Doh!
def value = 'some value'
jr."$end" = value