Class: Xommelier::Xml::Element::Structure::Attribute
- Inherits:
-
Property
- Object
- Property
- Xommelier::Xml::Element::Structure::Attribute
show all
- Defined in:
- lib/xommelier/xml/element/structure/property.rb
Constant Summary
collapse
- DEFAULTS =
{
type: String,
required: false,
optional: true,
xml: false
}.freeze
Instance Attribute Summary
Attributes inherited from Property
#name, #options
Instance Method Summary
collapse
Methods inherited from Property
#complex_type?, #default, #default?, #initialize, #inspect, #ns, #type, #writer
Instance Method Details
#attribute_name ⇒ Object
140
141
142
143
144
145
146
|
# File 'lib/xommelier/xml/element/structure/property.rb', line 140
def attribute_name
@attribute_name ||= if xml?
"xml:#{name}"
else
options.delete(:as) { name }.to_s
end
end
|
#node_type ⇒ Object
128
129
130
|
# File 'lib/xommelier/xml/element/structure/property.rb', line 128
def node_type
:attribute
end
|
132
133
134
|
# File 'lib/xommelier/xml/element/structure/property.rb', line 132
def required?
options[:required]
end
|
136
137
138
|
# File 'lib/xommelier/xml/element/structure/property.rb', line 136
def xml?
options[:xml]
end
|