Wrapping it all in a class when it is ultimately called as a module is kind of silly, as is using send().
It’s funny because I wouldn’t say anything if the author had made it a PORO with no state.
This breaks every convention in both Ruby and functional land. The fact that this is a program for parsing city nodes, and there is no CityNode class, is a red flag. Objects are nouns and functions are verbs. Maybe another way to implement this would have been a CityNode class with to_json, from_json, to_xml and from_xml methods. And stay away from send.
Agreed! It makes a lot more sense to parse the JSON into some internal structure, then serialize that as XML. And for this particular example, you only need from_json and to_xml.
Not quite what I was expecting. I guess I interpreted the name of this to indicate “using pure functions as an object” a la let-over-lambda (http://letoverlambda.com/textmode.cl/guest/chap2.html), but I guess this really just meant using internal/private methods with a public method as the external interface?