Class: Giblish::DocInfo
- Inherits:
-
Object
- Object
- Giblish::DocInfo
- Defined in:
- lib/giblish/docinfo.rb
Overview
Container class for bundling together the data we cache for each asciidoc file we come across
Defined Under Namespace
Classes: DocHistory
Instance Attribute Summary collapse
-
#converted ⇒ Object
Returns the value of attribute converted.
-
#doc_id ⇒ Object
Returns the value of attribute doc_id.
-
#error_msg ⇒ Object
Returns the value of attribute error_msg.
-
#history ⇒ Object
Returns the value of attribute history.
-
#purpose_str ⇒ Object
Returns the value of attribute purpose_str.
-
#rel_path ⇒ Object
readonly
Returns the value of attribute rel_path.
-
#src_file ⇒ Object
Returns the value of attribute src_file.
-
#status ⇒ Object
Returns the value of attribute status.
-
#stderr ⇒ Object
Returns the value of attribute stderr.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(adoc: nil, dst_root_abs: nil, adoc_stderr: "") ⇒ DocInfo
constructor
A new instance of DocInfo.
- #to_s ⇒ Object
Constructor Details
#initialize(adoc: nil, dst_root_abs: nil, adoc_stderr: "") ⇒ DocInfo
Returns a new instance of DocInfo.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/giblish/docinfo.rb', line 28 def initialize(adoc: nil, dst_root_abs: nil, adoc_stderr: "") @src_file = nil @history = [] @converted = true @stderr = adoc_stderr return unless adoc # Get the purpose info if it exists @purpose_str = get_purpose_info adoc # fill in doc meta data d_attr = adoc.attributes self.src_file = (d_attr["docfile"]) self.title = (adoc.doctitle) @doc_id = d_attr["docid"] return if dst_root_abs.nil? # Get the relative path beneath the root dir to the doc @rel_path = Pathname.new( "#{d_attr['outdir']}/#{d_attr['docname']}#{d_attr['docfilesuffix']}".encode("utf-8") ).relative_path_from(dst_root_abs) end |
Instance Attribute Details
#converted ⇒ Object
Returns the value of attribute converted.
12 13 14 |
# File 'lib/giblish/docinfo.rb', line 12 def converted @converted end |
#doc_id ⇒ Object
Returns the value of attribute doc_id.
12 13 14 |
# File 'lib/giblish/docinfo.rb', line 12 def doc_id @doc_id end |
#error_msg ⇒ Object
Returns the value of attribute error_msg.
12 13 14 |
# File 'lib/giblish/docinfo.rb', line 12 def error_msg @error_msg end |
#history ⇒ Object
Returns the value of attribute history.
12 13 14 |
# File 'lib/giblish/docinfo.rb', line 12 def history @history end |
#purpose_str ⇒ Object
Returns the value of attribute purpose_str.
12 13 14 |
# File 'lib/giblish/docinfo.rb', line 12 def purpose_str @purpose_str end |
#rel_path ⇒ Object (readonly)
Returns the value of attribute rel_path.
13 14 15 |
# File 'lib/giblish/docinfo.rb', line 13 def rel_path @rel_path end |
#src_file ⇒ Object
Returns the value of attribute src_file.
13 14 15 |
# File 'lib/giblish/docinfo.rb', line 13 def src_file @src_file end |
#status ⇒ Object
Returns the value of attribute status.
12 13 14 |
# File 'lib/giblish/docinfo.rb', line 12 def status @status end |
#stderr ⇒ Object
Returns the value of attribute stderr.
12 13 14 |
# File 'lib/giblish/docinfo.rb', line 12 def stderr @stderr end |
#title ⇒ Object
Returns the value of attribute title.
13 14 15 |
# File 'lib/giblish/docinfo.rb', line 13 def title @title end |
Instance Method Details
#to_s ⇒ Object
51 52 53 |
# File 'lib/giblish/docinfo.rb', line 51 def to_s "DocInfo: title: #{@title} src_file: #{@src_file}" end |