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

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

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.



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

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.



19
20
21
# File 'lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code.rb', line 19

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)


76
77
78
79
80
81
82
# File 'lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code.rb', line 76

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)


45
46
47
# File 'lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code.rb', line 45

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)


66
67
68
# File 'lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/code.rb', line 66

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