Class: Kramdown::PlantUml::Theme
- Defined in:
- lib/kramdown-plantuml/theme.rb
Overview
Provides theming support for PlantUML
Instance Attribute Summary collapse
-
#directory ⇒ Object
readonly
Returns the value of attribute directory.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#scale ⇒ Object
readonly
Returns the value of attribute scale.
Instance Method Summary collapse
- #apply(plantuml) ⇒ Object
-
#initialize(options) ⇒ Theme
constructor
A new instance of Theme.
Constructor Details
#initialize(options) ⇒ Theme
Returns a new instance of Theme.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/kramdown-plantuml/theme.rb', line 13 def initialize() raise ArgumentError, 'options cannot be nil' if .nil? raise ArgumentError, "options must be a '#{Options}'." unless .is_a?(Options) @raise_errors = .raise_errors? @logger = LogWrapper.init @name = .theme_name @scale = .scale @directory = resolve .theme_directory end |
Instance Attribute Details
#directory ⇒ Object (readonly)
Returns the value of attribute directory.
11 12 13 |
# File 'lib/kramdown-plantuml/theme.rb', line 11 def directory @directory end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/kramdown-plantuml/theme.rb', line 11 def name @name end |
#scale ⇒ Object (readonly)
Returns the value of attribute scale.
11 12 13 |
# File 'lib/kramdown-plantuml/theme.rb', line 11 def scale @scale end |
Instance Method Details
#apply(plantuml) ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/kramdown-plantuml/theme.rb', line 24 def apply(plantuml) if plantuml.nil? || !plantuml.is_a?(String) || plantuml.empty? @logger.debug 'Empty diagram or not a String.' return plantuml end theme(plantuml) end |