Class: JsDependency::Mermaid::NodesLink
- Inherits:
-
Object
- Object
- JsDependency::Mermaid::NodesLink
- Defined in:
- lib/js_dependency/mermaid/nodes_link.rb
Instance Attribute Summary collapse
-
#child ⇒ Object
readonly
Returns the value of attribute child.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
- #child_module_name(level = 0) ⇒ String
-
#initialize(parent, child) ⇒ NodesLink
constructor
A new instance of NodesLink.
- #parent_module_name(level = 0) ⇒ String
- #relative_path_from(src_path) ⇒ JsDependency::Mermaid::NodesLink
Constructor Details
#initialize(parent, child) ⇒ NodesLink
Returns a new instance of NodesLink.
12 13 14 15 |
# File 'lib/js_dependency/mermaid/nodes_link.rb', line 12 def initialize(parent, child) @parent = Pathname.new(parent) @child = Pathname.new(child) end |
Instance Attribute Details
#child ⇒ Object (readonly)
Returns the value of attribute child.
8 9 10 |
# File 'lib/js_dependency/mermaid/nodes_link.rb', line 8 def child @child end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
8 9 10 |
# File 'lib/js_dependency/mermaid/nodes_link.rb', line 8 def parent @parent end |
Instance Method Details
#child_module_name(level = 0) ⇒ String
25 26 27 |
# File 'lib/js_dependency/mermaid/nodes_link.rb', line 25 def child_module_name(level = 0) mermaid_str(@child, level) end |
#parent_module_name(level = 0) ⇒ String
19 20 21 |
# File 'lib/js_dependency/mermaid/nodes_link.rb', line 19 def parent_module_name(level = 0) mermaid_str(@parent, level) end |
#relative_path_from(src_path) ⇒ JsDependency::Mermaid::NodesLink
31 32 33 34 35 36 |
# File 'lib/js_dependency/mermaid/nodes_link.rb', line 31 def relative_path_from(src_path) NodesLink.new( relative_parent_path(src_path), relative_child_path(src_path) ) end |