Empact / roxml

ROXML is a module for binding Ruby classes to XML. It supports custom mapping and bidirectional marshalling between Ruby and XML using annotation-style class methods, via Nokogiri or LibXML.
http://roxml.rubyforge.org/
MIT License
223 stars 176 forks source link

Cannot override autoparsed DateTime (e.g. 'created_at') class using :as option #23

Closed findchris closed 14 years ago

findchris commented 14 years ago

From History.txt: Default attrs ending in '_at' to DateTime. This can be overriden via :as

I have a ROXML class with a 'created_at' XML accessor. I do not want the value to be auto-parsed to a DateTime. So I tried to override this use the :as option (per the History.txt) two different ways. See below: xml_accessor :created_at, :as => :text xml_accessor :created_at, :as => String

In both cases, I get an: ArgumentError: Invalid :as argument

Either this is a bug or my syntax is off. Any guidance?

Cheers.

findchris commented 14 years ago

Fixed in my fork: http://github.com/findchris/roxml