Class: ActiveRecord::XmlSerializer
- Inherits:
-
Object
- Object
- ActiveRecord::XmlSerializer
- Defined in:
- lib/restfulx/active_foo.rb
Overview
Change the xml serializer so that ‘?’s are stripped from attribute names. This makes it possible to serialize methods that end in a question mark, like ‘valid?’ or ‘is_true?’
Defined Under Namespace
Classes: Attribute
Instance Method Summary collapse
-
#add_tag(attribute) ⇒ Object
Strips ‘?’ from serialized method names.
Instance Method Details
#add_tag(attribute) ⇒ Object
Strips ‘?’ from serialized method names
140 141 142 143 144 145 146 |
# File 'lib/restfulx/active_foo.rb', line 140 def add_tag(attribute) builder.tag!( dasherize? ? attribute.display_name.dasherize : attribute.display_name, attribute.value.to_s, attribute.decorations(![:skip_types]) ) end |