Class: StixSchemaSpy::Element

Inherits:
Node
  • Object
show all
Defined in:
lib/stix_schema_spy/models/element.rb

Instance Attribute Summary

Attributes inherited from Node

#containing_type, #documentation, #schema

Instance Method Summary collapse

Methods inherited from Node

#element?, #initialize, #inspect, #link, #name, #name!, #reference?, #referenced_element, #stix_version, #type, #type!

Constructor Details

This class inherits a constructor from StixSchemaSpy::Node

Instance Method Details

#attribute?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/stix_schema_spy/models/element.rb', line 7

def attribute?
  false
end

#max_occursObject



15
16
17
# File 'lib/stix_schema_spy/models/element.rb', line 15

def max_occurs
  @xml.attributes['maxOccurs'] ? @xml.attributes['maxOccurs'].value : "1"
end

#min_occursObject



11
12
13
# File 'lib/stix_schema_spy/models/element.rb', line 11

def min_occurs
  @xml.attributes['minOccurs'] ? @xml.attributes['minOccurs'].value : "1"
end