Logan Capaldo
7/31/2006 5:44:00 PM
On Jul 31, 2006, at 11:16 AM, Tim Bray wrote:
> On Jul 31, 2006, at 6:16 AM, chiaro scuro wrote:
>
>> What I need to do is to be able to traverse an xml document as in:
>>
>> * people.each_person {...}
>> * people.person[2].name
>> * people.person.name #takes the first person
>> * people.person.size
>
> Consider
>
> <vocab-item>
> <first.form>foo</first.form>
> <second.form>föö</second.form>
> </vocab-item>
>
> That's legal XML. Ruby n00b question: can you work around problems
> like "vocab-item" and "first.form" in Ruby? -Tim
>
Workaround is the word <g>
class A
define_method("@+$%!") { puts "Snoopy talk!" }
end
a = A.new
a.send("@+$%!")