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

Inherits:
Object
  • Object
show all
Defined in:
lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/template.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.

Instance Method Summary collapse

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)


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

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

  true
end

#absolute_pathString

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.

Returns:

  • (String)


34
35
36
# File 'lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/template.rb', line 34

def absolute_path
  @absolute_path ||= ::File.expand_path(relative_path, __dir__)
end

#contentString

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.

Returns:

  • (String)


52
53
54
# File 'lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/template.rb', line 52

def content
  @content ||= ::File.read(absolute_path)
end

#erbERB

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.

Returns:

  • (ERB)


43
44
45
# File 'lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/template.rb', line 43

def erb
  @erb ||= ::ERB.new(content)
end

#relative_pathString

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.

Returns:

  • (String)


21
22
23
# File 'lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/template.rb', line 21

def relative_path
  @relative_path ||= ::File.join("..", "templates", "flowchart.html.erb")
end

#render(**replacements) ⇒ String

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:

  • replacements (Hash{Symbol => Object})

Returns:

  • (String)

See Also:



68
69
70
# File 'lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/template.rb', line 68

def render(**replacements)
  erb.result_with_hash(replacements)
end