Class: Ea::Sources::Qea::Xref::StereotypeApplication

Inherits:
Struct
  • Object
show all
Defined in:
lib/ea/sources/qea/xref/stereotype_application.rb

Overview

Stereotype application record. Produced when the Description starts with @STEREO;. Captures the short name and the fully-qualified tech::Stereo form when present.

Example source:

@STEREO;Name=FeatureType;FQName=GML::FeatureType;@ENDSTEREO;

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fqnameObject

Returns the value of attribute fqname

Returns:

  • (Object)

    the current value of fqname



13
14
15
# File 'lib/ea/sources/qea/xref/stereotype_application.rb', line 13

def fqname
  @fqname
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



13
14
15
# File 'lib/ea/sources/qea/xref/stereotype_application.rb', line 13

def name
  @name
end

Instance Method Details

#technologyString?

Returns the technology prefix from FQName, or nil.

Returns:

  • (String, nil)


16
17
18
19
20
21
# File 'lib/ea/sources/qea/xref/stereotype_application.rb', line 16

def technology
  return nil unless fqname

  idx = fqname.index("::")
  idx ? fqname[0, idx] : nil
end

#unqualified_nameString?

Returns the stereotype name without technology prefix. Falls back to name when FQName is absent.

Returns:

  • (String, nil)


26
27
28
29
30
31
32
# File 'lib/ea/sources/qea/xref/stereotype_application.rb', line 26

def unqualified_name
  if fqname && fqname.include?("::")
    fqname.split("::", 2).last
  else
    name
  end
end