Class: StixSchemaSpy::ExternalType

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (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

Returns:

  • (Boolean)


37
38
39
# File 'lib/stix_schema_spy/models/external_type.rb', line 37

def abstract?
  false
end

#attributesObject



65
66
67
# File 'lib/stix_schema_spy/models/external_type.rb', line 65

def attributes
  []
end

#child_typesObject



33
34
35
# File 'lib/stix_schema_spy/models/external_type.rb', line 33

def child_types
  []
end

#documentationObject



53
54
55
# File 'lib/stix_schema_spy/models/external_type.rb', line 53

def documentation
  ""
end

#elementsObject



69
70
71
# File 'lib/stix_schema_spy/models/external_type.rb', line 69

def elements
  []
end

#fieldsObject



61
62
63
# File 'lib/stix_schema_spy/models/external_type.rb', line 61

def fields
  []
end

#full_nameObject



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

Returns:

  • (Boolean)


57
58
59
# File 'lib/stix_schema_spy/models/external_type.rb', line 57

def has_example?
  false
end

#has_own_fields?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/stix_schema_spy/models/external_type.rb', line 41

def has_own_fields?
  false
end

#own_usagesObject



25
26
27
# File 'lib/stix_schema_spy/models/external_type.rb', line 25

def own_usages
  []
end

#prefixObject



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

def prefix
  @prefix || ""
end

#urlObject



73
74
75
# File 'lib/stix_schema_spy/models/external_type.rb', line 73

def url
  nil
end

#usagesObject



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