Class: StixSchemaSpy::ExternalType
- Inherits:
-
Object
- Object
- StixSchemaSpy::ExternalType
- Defined in:
- lib/stix_schema_spy/models/external_type.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #abstract? ⇒ Boolean
- #attributes ⇒ Object
- #child_types ⇒ Object
- #documentation ⇒ Object
- #elements ⇒ Object
- #fields ⇒ Object
- #full_name ⇒ Object
- #has_example? ⇒ Boolean
- #has_own_fields? ⇒ Boolean
-
#initialize(prefix, name) ⇒ ExternalType
constructor
A new instance of ExternalType.
- #own_usages ⇒ Object
- #prefix ⇒ Object
- #url ⇒ Object
- #usages ⇒ Object
-
#use(by) ⇒ Object
For compatibility w/ normal types.
- #use_parent(child) ⇒ Object
Constructor Details
#initialize(prefix, name) ⇒ ExternalType
Returns a new instance of ExternalType.
7 8 9 10 |
# File 'lib/stix_schema_spy/models/external_type.rb', line 7 def initialize(prefix, name) @prefix = prefix @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/stix_schema_spy/models/external_type.rb', line 5 def name @name end |
Instance Method Details
#abstract? ⇒ Boolean
37 38 39 |
# File 'lib/stix_schema_spy/models/external_type.rb', line 37 def abstract? false end |
#attributes ⇒ Object
65 66 67 |
# File 'lib/stix_schema_spy/models/external_type.rb', line 65 def attributes [] end |
#child_types ⇒ Object
33 34 35 |
# File 'lib/stix_schema_spy/models/external_type.rb', line 33 def child_types [] end |
#documentation ⇒ Object
53 54 55 |
# File 'lib/stix_schema_spy/models/external_type.rb', line 53 def documentation "" end |
#elements ⇒ Object
69 70 71 |
# File 'lib/stix_schema_spy/models/external_type.rb', line 69 def elements [] end |
#fields ⇒ Object
61 62 63 |
# File 'lib/stix_schema_spy/models/external_type.rb', line 61 def fields [] end |
#full_name ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/stix_schema_spy/models/external_type.rb', line 45 def full_name if prefix && prefix.length > 0 "#{prefix}:#{name}" else name end end |
#has_example? ⇒ Boolean
57 58 59 |
# File 'lib/stix_schema_spy/models/external_type.rb', line 57 def has_example? false end |
#has_own_fields? ⇒ Boolean
41 42 43 |
# File 'lib/stix_schema_spy/models/external_type.rb', line 41 def has_own_fields? false end |
#own_usages ⇒ Object
25 26 27 |
# File 'lib/stix_schema_spy/models/external_type.rb', line 25 def own_usages [] end |
#prefix ⇒ Object
12 13 14 |
# File 'lib/stix_schema_spy/models/external_type.rb', line 12 def prefix @prefix || "" end |
#url ⇒ Object
73 74 75 |
# File 'lib/stix_schema_spy/models/external_type.rb', line 73 def url nil end |
#usages ⇒ Object
21 22 23 |
# File 'lib/stix_schema_spy/models/external_type.rb', line 21 def usages [] end |
#use(by) ⇒ Object
For compatibility w/ normal types
17 18 19 |
# File 'lib/stix_schema_spy/models/external_type.rb', line 17 def use(by) return self end |
#use_parent(child) ⇒ Object
29 30 31 |
# File 'lib/stix_schema_spy/models/external_type.rb', line 29 def use_parent(child) self end |