Class: XsdModel::Elements::Element
- Inherits:
-
Object
- Object
- XsdModel::Elements::Element
show all
- Includes:
- BaseElement
- Defined in:
- lib/xsd_model/elements/element.rb
Constant Summary
Constants included
from BaseElement
BaseElement::XSD_URI
Instance Attribute Summary
Attributes included from BaseElement
#attributes, #children, #namespaces
Instance Method Summary
collapse
#==, #basic_xsd_type?, #element_name, #empty?, #has_custom_type?, #initialize, #method_missing, #name_with_prefix, #reverse_traverse, #type_with_prefix, #xmlns_prefix, #xmlns_uri, #xsd_prefix
#attribute_method
Instance Method Details
#has_ref? ⇒ Boolean
23
24
25
|
# File 'lib/xsd_model/elements/element.rb', line 23
def has_ref?
!ref.nil?
end
|
#max_occurs ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/xsd_model/elements/element.rb', line 6
def max_occurs
value = attributes['maxOccurs']
case value
when 'unbounded'
then Float::INFINITY
when String
then value.to_i
when nil
then 1
end
end
|
#multiple? ⇒ Boolean
19
20
21
|
# File 'lib/xsd_model/elements/element.rb', line 19
def multiple?
max_occurs > 1
end
|
#ref ⇒ Object
27
28
29
|
# File 'lib/xsd_model/elements/element.rb', line 27
def ref
attributes['ref']
end
|