Class: JsDependency::Mermaid::TargetPathname

Inherits:
Object
  • Object
show all
Defined in:
lib/js_dependency/mermaid/target_pathname.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target_path) ⇒ TargetPathname

Returns a new instance of TargetPathname.

Parameters:

  • target_path (String)


10
11
12
13
14
# File 'lib/js_dependency/mermaid/target_pathname.rb', line 10

def initialize(target_path)
  @pathname = to_target_pathname(target_path)
  @color_css = "#f9f"
  @font_size_css = "4px"
end

Instance Attribute Details

#color_cssObject

Returns the value of attribute color_css.



7
8
9
# File 'lib/js_dependency/mermaid/target_pathname.rb', line 7

def color_css
  @color_css
end

#font_size_cssObject

Returns the value of attribute font_size_css.



7
8
9
# File 'lib/js_dependency/mermaid/target_pathname.rb', line 7

def font_size_css
  @font_size_css
end

Instance Method Details

#mermaid_style(src_path) ⇒ String

Parameters:

  • src_path (String)

Returns:

  • (String)


18
19
20
21
# File 'lib/js_dependency/mermaid/target_pathname.rb', line 18

def mermaid_style(src_path)
  src_pathname = Pathname.new(src_path).realpath
  export_style(parse(@pathname.exist? ? @pathname.relative_path_from(src_pathname) : @pathname).join("_"))
end