Class: Peanuts::Mappings::Attribute

Inherits:
MemberMapping show all
Includes:
SingleMapping, ValueMapping
Defined in:
lib/peanuts/mappings.rb

Instance Attribute Summary

Attributes inherited from MemberMapping

#converter, #name, #type

Attributes inherited from Peanuts::Mapping

#options, #prefix, #xmlname, #xmlns

Instance Method Summary collapse

Methods inherited from MemberMapping

#clear, #restore, #save

Methods inherited from Peanuts::Mapping

#node_type, node_type

Constructor Details

#initialize(name, type, options) ⇒ Attribute

Returns a new instance of Attribute.

Raises:

  • (ArgumentError)


158
159
160
161
# File 'lib/peanuts/mappings.rb', line 158

def initialize(name, type, options)
  super
  raise ArgumentError, 'a namespaced attribute must have namespace prefix' if xmlns && !prefix
end