Module: Ea::Svg::EaEmitter::VisibilitySymbol
- Defined in:
- lib/ea/svg/ea_emitter/visibility_symbol.rb
Overview
Maps UML visibility strings to EA's single-character symbols.
Centralised so that adding a new visibility level (e.g. "implementation" in Java) changes one hash entry, not three case/when branches across separate renderer files.
EA's convention:
+ public
- private
# protected
~ package
Constant Summary collapse
- SYMBOLS =
{ "public" => "+", "private" => "-", "protected" => "#", "package" => "~" }.freeze
Class Method Summary collapse
-
.for(visibility, with_space: false) ⇒ String
The UML visibility symbol.
Class Method Details
.for(visibility, with_space: false) ⇒ String
Returns the UML visibility symbol.
30 31 32 33 |
# File 'lib/ea/svg/ea_emitter/visibility_symbol.rb', line 30 def self.for(visibility, with_space: false) symbol = SYMBOLS[(visibility || "public").downcase] || "+" with_space ? "#{symbol} " : symbol end |