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

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

Instance Method Summary collapse

Constructor Details

#initialize(flowchart:, hash: {}) ⇒ 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.



32
33
34
35
# File 'lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/settings.rb', line 32

def initialize(flowchart:, hash: {})
  @flowchart = flowchart
  @hash = hash
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.



17
18
19
# File 'lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/settings.rb', line 17

def flowchart
  @flowchart
end

#hashObject (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.



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

def hash
  @hash
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)


129
130
131
132
133
134
135
136
# File 'lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/settings.rb', line 129

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

  return false if flowchart != other.flowchart
  return false if hash != other.hash

  true
end

#absolute_pathString

Returns:

  • (String)


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

def absolute_path
  hash.fetch(:absolute_path) { default_absolute_path }
end

#absolute_path=(other_absolute_path) ⇒ String

Returns:

  • (String)


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

def absolute_path=(other_absolute_path)
  hash[:absolute_path] = other_absolute_path
end

#default_absolute_pathString

Returns:

  • (String)


60
61
62
# File 'lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/settings.rb', line 60

def default_absolute_path
  ::File.join(::Dir.pwd, "flowchart.html")
end

#default_directionObject

Possible FlowChart directions are: TB - Top to bottom TD - Top-down/ same as top to bottom BT - Bottom to top RL - Right to left LR - Left to right



94
95
96
# File 'lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/settings.rb', line 94

def default_direction
  "LR"
end

#default_titleObject



119
120
121
# File 'lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/settings.rb', line 119

def default_title
  Utils::Class.display_name(flowchart.service)
end

#directionString

Returns:

  • (String)


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

def direction
  hash.fetch(:direction) { default_direction }
end

#direction=(other_direction) ⇒ String

Returns:

  • (String)


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

def direction=(other_direction)
  hash[:direction] = other_direction
end

#titleString

Returns:

  • (String)


103
104
105
# File 'lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/settings.rb', line 103

def title
  hash.fetch(:title) { default_title }
end

#title=(other_title) ⇒ String

Returns:

  • (String)


112
113
114
# File 'lib/convenient_service/service/plugins/has_mermaid_flowchart/entities/flowchart/entities/settings.rb', line 112

def title=(other_title)
  hash[:title] = other_title
end