Class: Lagoon::Diagram::Base
- Inherits:
-
Object
- Object
- Lagoon::Diagram::Base
- Defined in:
- lib/lagoon/diagram/base.rb,
sig/lagoon.rbs
Direct Known Subclasses
ControllerDiagram, ControllerModelDiagram, ErDiagram, ModelDiagram
Instance Attribute Summary collapse
-
#config ⇒ Configuration
readonly
Returns the value of attribute config.
-
#options ⇒ Options
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #generate ⇒ Result
-
#initialize(options = nil, configuration: Lagoon.configuration.dup, **keyword_options) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(options = nil, configuration: Lagoon.configuration.dup, **keyword_options) ⇒ Base
Returns a new instance of Base.
11 12 13 14 15 |
# File 'lib/lagoon/diagram/base.rb', line 11 def initialize( = nil, configuration: Lagoon.configuration.dup, **) @config = configuration = ( || {}).to_h.merge() @options = Options.for(diagram_kind, , config: @config) end |
Instance Attribute Details
#config ⇒ Configuration (readonly)
Returns the value of attribute config.
9 10 11 |
# File 'lib/lagoon/diagram/base.rb', line 9 def config @config end |
#options ⇒ Options (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/lagoon/diagram/base.rb', line 9 def @options end |
Instance Method Details
#generate ⇒ Result
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/lagoon/diagram/base.rb', line 17 def generate parsed_data = parser.parse content = renderer.render(parsed_data) path = write_to_file(content) Result.new( path: path, content: content, warnings: parsed_data.fetch(:warnings, []), counts: parsed_data.fetch(:counts, infer_counts(parsed_data)) ) end |