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

#local_name, #namespace_uri, #options, #prefix

Instance Method Summary collapse

Methods inherited from MemberMapping

#clear, #define_accessors, #read, #write

Methods inherited from Peanuts::Mapping

#matches?, node_type

Constructor Details

#initialize(name, type, options) ⇒ Attribute

Returns a new instance of Attribute.

Raises:

  • (ArgumentError)


200
201
202
203
# File 'lib/peanuts/mappings.rb', line 200

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