50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
# File 'lib/saxomattic.rb', line 50
def attribute(*args)
options = args.
field = args.first
if options[:elements] && !options[:elements].kind_of?(Array)
options.merge!(:default => [])
end
_active_attr_attribute(field, _active_attr_attributes(options.dup))
case
when options[:ancestor] then
_sax_machine_ancestor(field, _sax_machine_attributes(options.dup))
when options[:attribute] then
_sax_machine_attribute(field, _sax_machine_attributes(options.dup))
when options[:elements] then
_sax_machine_elements(field, _sax_machine_attributes(options.dup))
when options[:value] then
_sax_machine_value(field, _sax_machine_attributes(options.dup))
else _sax_machine_element(field, _sax_machine_attributes(options.dup))
end
end
|