Class: ConvenientService::Service::Plugins::HasMermaidFlowchart::Entities::Flowchart::Entities::Code Private

Inherits:
Object
  • Object
show all
Defined in:
lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code.rb,
lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code/commands/generate_lines.rb,
lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code/commands/generate_result_lines.rb,
lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code/commands/generate_service_lines.rb,
lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code/commands/generate_method_step_lines.rb,
lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code/commands/generate_service_step_lines.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Defined Under Namespace

Modules: Commands

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(flowchart:) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



31
32
33
# File 'lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code.rb', line 31

def initialize(flowchart:)
  @flowchart = flowchart
end

Instance Attribute Details

#flowchartObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



24
25
26
# File 'lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code.rb', line 24

def flowchart
  @flowchart
end

Instance Method Details

#==(other) ⇒ Boolean?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • other (Object)

Returns:

  • (Boolean, nil)


81
82
83
84
85
86
87
# File 'lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code.rb', line 81

def ==(other)
  return unless other.instance_of?(self.class)

  return false if flowchart != other.flowchart

  true
end

#generateString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Examples:

Generated code for a service with steps, but without nested steps.


flowchart LR
  7900[ConvenientService::Examples::Standard::Gemfile::Services::ReadFileContent] --> 7900-validate_path[ConvenientService::Examples::Standard::Gemfile::Services::ReadFileContent#validate_path]
  7900[ConvenientService::Examples::Standard::Gemfile::Services::ReadFileContent] --> 7900-7920[ConvenientService::Examples::Standard::Gemfile::Services::AssertFileExists]
  7900-7920[ConvenientService::Examples::Standard::Gemfile::Services::AssertFileExists] --> 7900-7920-result[ConvenientService::Examples::Standard::Gemfile::Services::AssertFileExists#result]
  7900[ConvenientService::Examples::Standard::Gemfile::Services::ReadFileContent] --> 7900-7940[ConvenientService::Examples::Standard::Gemfile::Services::AssertFileNotEmpty]
  7900-7940[ConvenientService::Examples::Standard::Gemfile::Services::AssertFileNotEmpty] --> 7900-7940-result[ConvenientService::Examples::Standard::Gemfile::Services::AssertFileNotEmpty#result]
  7900[ConvenientService::Examples::Standard::Gemfile::Services::ReadFileContent] --> 7900-result[ConvenientService::Examples::Standard::Gemfile::Services::ReadFileContent#result]

Returns:

  • (String)


50
51
52
# File 'lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code.rb', line 50

def generate
  lines.join("\n")
end

#linesString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Examples:

Generated code for a service with steps, but without nested steps.


[
  "flowchart LR",
  "  7900[ConvenientService::Examples::Standard::Gemfile::Services::ReadFileContent] --> 7900-validate_path[ConvenientService::Examples::Standard::Gemfile::Services::ReadFileContent#validate_path]",
  "  7900[ConvenientService::Examples::Standard::Gemfile::Services::ReadFileContent] --> 7900-7920[ConvenientService::Examples::Standard::Gemfile::Services::AssertFileExists]",
  "  7900-7920[ConvenientService::Examples::Standard::Gemfile::Services::AssertFileExists] --> 7900-7920-result[ConvenientService::Examples::Standard::Gemfile::Services::AssertFileExists#result]",
  "  7900[ConvenientService::Examples::Standard::Gemfile::Services::ReadFileContent] --> 7900-7940[ConvenientService::Examples::Standard::Gemfile::Services::AssertFileNotEmpty]",
  "  7900-7940[ConvenientService::Examples::Standard::Gemfile::Services::AssertFileNotEmpty] --> 7900-7940-result[ConvenientService::Examples::Standard::Gemfile::Services::AssertFileNotEmpty#result]",
  "  7900[ConvenientService::Examples::Standard::Gemfile::Services::ReadFileContent] --> 7900-result[ConvenientService::Examples::Standard::Gemfile::Services::ReadFileContent#result]"
]

Returns:

  • (String)


71
72
73
# File 'lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code.rb', line 71

def lines
  Commands::GenerateLines[code: self]
end