Class: StixSchemaSpy::Attribute

Inherits:
Node
  • Object
show all
Defined in:
lib/stix_schema_spy/models/attribute.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!, #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/attribute.rb', line 7

def attribute?
  true
end

#nameObject

Attribute names have an @ prefixed



12
13
14
# File 'lib/stix_schema_spy/models/attribute.rb', line 12

def name
  "@#{super}"
end

#useObject



16
17
18
# File 'lib/stix_schema_spy/models/attribute.rb', line 16

def use
  @xml.attributes['use'] ? @xml.attributes['use'].value : "optional"
end