Closed hozumi closed 13 years ago
Hi Takahiro!
Current XmlSimple use instance_of? to check class in every point. I prefer is_a? to instance_of?, because is_a? returns true with subclass of target class. The instance_of? returns true with only target class. This limitation often require conversion from subclass of Hash into Hash. For example, Mongoid use BSON::OrderedHash, which inherit Hash, to represent hash of models. So conversion is required when using XmlSimple#xml_out. What do you think? You are right and I have replaced instance_of? with is_a?.
Thank you very much!
Best, Maik
Maik Thank you very much too!
Hi,
Current XmlSimple use instance_of? to check class in every point. I prefer is_a? to instance_of?, because is_a? returns true with subclass of target class. The instance_of? returns true with only target class. This limitation often require conversion from subclass of Hash into Hash. For example, Mongoid use BSON::OrderedHash, which inherit Hash, to represent hash of models. So conversion is required when using XmlSimple#xml_out. What do you think?
Thanks.