Method: WebService::Aboutme::XmlObjectMapping::ClassMethods#attr_mapping
- Defined in:
- lib/webservice/aboutme/xmlobjectmapping.rb
#attr_mapping(name, args = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/webservice/aboutme/xmlobjectmapping.rb', line 12 def attr_mapping(name, args = {}) unless args[:private] attr_accessor name end mapping = { :name => name, :type => args[:type] || :string, :array => args[:array] || false, :subnode => args[:subnode], } path = args[:path] || name.to_s @attributes ||= {} @attributes[path] = mapping end |