Class: Giblish::SuccessfulConversion

Inherits:
ConversionInfo show all
Defined in:
lib/giblish/conversion_info.rb

Overview

Provide data and access methods available when a conversion has succeeded

Instance Attribute Summary collapse

Attributes inherited from ConversionInfo

#converted, #dst_node, #dst_top, #src_node, #src_rel_path

Instance Method Summary collapse

Methods inherited from ConversionInfo

#src_basename, #title, #to_s

Constructor Details

#initialize(src_node:, dst_node:, dst_top:, adoc:, adoc_stderr: "") ⇒ SuccessfulConversion

Returns a new instance of SuccessfulConversion.



70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/giblish/conversion_info.rb', line 70

def initialize(src_node:, dst_node:, dst_top:, adoc:, adoc_stderr: "")
  super(converted: true, src_node: src_node, dst_node: dst_node, dst_top: dst_top)

  @adoc = adoc
  @stderr = adoc_stderr
  @title = @adoc.doctitle

  @dst_rel_path = dst_node.relative_path_from(dst_top)

  # Cach the purpose info if it exists
  @purpose_str = get_purpose_info adoc
end

Instance Attribute Details

#adocObject (readonly)

Returns the value of attribute adoc.



62
63
64
# File 'lib/giblish/conversion_info.rb', line 62

def adoc
  @adoc
end

#dst_rel_pathObject (readonly)

The relative Pathname from the root dir to the dst file Ex Pathname(“my/subdir/file1.html”)



66
67
68
# File 'lib/giblish/conversion_info.rb', line 66

def dst_rel_path
  @dst_rel_path
end

#purpose_strObject (readonly)

Returns the value of attribute purpose_str.



68
69
70
# File 'lib/giblish/conversion_info.rb', line 68

def purpose_str
  @purpose_str
end

#stderrObject (readonly)

Returns the value of attribute stderr.



62
63
64
# File 'lib/giblish/conversion_info.rb', line 62

def stderr
  @stderr
end

Instance Method Details

#docidObject



83
84
85
# File 'lib/giblish/conversion_info.rb', line 83

def docid
  @adoc.attributes["docid"]
end