Class: StixSchemaSpy::Attribute
- Defined in:
- lib/stix_schema_spy/models/attribute.rb
Instance Attribute Summary
Attributes inherited from Node
#containing_type, #documentation, #schema
Instance Method Summary collapse
- #attribute? ⇒ Boolean
-
#name ⇒ Object
Attribute names have an @ prefixed.
- #use ⇒ Object
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
7 8 9 |
# File 'lib/stix_schema_spy/models/attribute.rb', line 7 def attribute? true end |
#name ⇒ Object
Attribute names have an @ prefixed
12 13 14 |
# File 'lib/stix_schema_spy/models/attribute.rb', line 12 def name "@#{super}" end |
#use ⇒ Object
16 17 18 |
# File 'lib/stix_schema_spy/models/attribute.rb', line 16 def use @xml.attributes['use'] ? @xml.attributes['use'].value : "optional" end |