Class: Ea::Sources::Qea::Xref::Record
- Inherits:
-
Struct
- Object
- Struct
- Ea::Sources::Qea::Xref::Record
- Defined in:
- lib/ea/sources/qea/xref/record.rb
Overview
Parsed t_xref.Description. Holds typed records for each block
found in the source string. One Description can carry multiple
records (e.g., several @PROP= blocks defining a stereotype's
tagged-value set).
Consumers branch on record type without re-parsing strings.
Instance Attribute Summary collapse
-
#key_values ⇒ Object
Returns the value of attribute key_values.
-
#legends ⇒ Object
Returns the value of attribute legends.
-
#properties ⇒ Object
Returns the value of attribute properties.
-
#raw ⇒ Object
Returns the value of attribute raw.
-
#stereotype ⇒ Object
Returns the value of attribute stereotype.
Instance Method Summary collapse
-
#initialize ⇒ Record
constructor
A new instance of Record.
-
#legend? ⇒ Boolean
True when at least one legend is present.
-
#legend_title ⇒ String?
Convenience: first legend's name (the legend's title).
-
#stereotype? ⇒ Boolean
True when a stereotype application is present.
Constructor Details
#initialize ⇒ Record
Returns a new instance of Record.
15 16 17 18 19 20 |
# File 'lib/ea/sources/qea/xref/record.rb', line 15 def initialize(*) super self.properties ||= [] self.legends ||= [] self.key_values ||= {} end |
Instance Attribute Details
#key_values ⇒ Object
Returns the value of attribute key_values
13 14 15 |
# File 'lib/ea/sources/qea/xref/record.rb', line 13 def key_values @key_values end |
#legends ⇒ Object
Returns the value of attribute legends
13 14 15 |
# File 'lib/ea/sources/qea/xref/record.rb', line 13 def legends @legends end |
#properties ⇒ Object
Returns the value of attribute properties
13 14 15 |
# File 'lib/ea/sources/qea/xref/record.rb', line 13 def properties @properties end |
#raw ⇒ Object
Returns the value of attribute raw
13 14 15 |
# File 'lib/ea/sources/qea/xref/record.rb', line 13 def raw @raw end |
#stereotype ⇒ Object
Returns the value of attribute stereotype
13 14 15 |
# File 'lib/ea/sources/qea/xref/record.rb', line 13 def stereotype @stereotype end |
Instance Method Details
#legend? ⇒ Boolean
Returns true when at least one legend is present.
28 29 30 |
# File 'lib/ea/sources/qea/xref/record.rb', line 28 def legend? !legends.empty? end |
#legend_title ⇒ String?
Convenience: first legend's name (the legend's title).
34 35 36 |
# File 'lib/ea/sources/qea/xref/record.rb', line 34 def legend_title legends.first&.name end |
#stereotype? ⇒ Boolean
Returns true when a stereotype application is present.
23 24 25 |
# File 'lib/ea/sources/qea/xref/record.rb', line 23 def stereotype? !stereotype.nil? end |