Class: RD::OutputFormatVisitor
- Includes:
- SearchFile
- Defined in:
- lib/rd2odt/rdtool/rd/output-format-visitor.rb
Direct Known Subclasses
Constant Summary collapse
- OUTPUT_SUFFIX =
must-have constants
""
- INCLUDE_SUFFIX =
[]
Constants inherited from Visitor
Visitor::SYSTEM_NAME, Visitor::SYSTEM_VERSION, Visitor::VERSION
Instance Attribute Summary collapse
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#include_suffix ⇒ Object
Returns the value of attribute include_suffix.
Instance Method Summary collapse
- #apply_to_Include(element) ⇒ Object
-
#initialize ⇒ OutputFormatVisitor
constructor
A new instance of OutputFormatVisitor.
Methods included from SearchFile
Methods inherited from Visitor
define_visit_Nonterminal, define_visit_Terminal, version, #visit, #visit_DescListItem, #visit_MethodListItem, #visit_Reference, #visit_children
Constructor Details
#initialize ⇒ OutputFormatVisitor
Returns a new instance of OutputFormatVisitor.
16 17 18 19 20 |
# File 'lib/rd2odt/rdtool/rd/output-format-visitor.rb', line 16 def initialize super @include_suffix = self.class::INCLUDE_SUFFIX.clone @filename = nil end |
Instance Attribute Details
#filename ⇒ Object
Returns the value of attribute filename.
14 15 16 |
# File 'lib/rd2odt/rdtool/rd/output-format-visitor.rb', line 14 def filename @filename end |
#include_suffix ⇒ Object
Returns the value of attribute include_suffix.
13 14 15 |
# File 'lib/rd2odt/rdtool/rd/output-format-visitor.rb', line 13 def include_suffix @include_suffix end |
Instance Method Details
#apply_to_Include(element) ⇒ Object
22 23 24 25 26 |
# File 'lib/rd2odt/rdtool/rd/output-format-visitor.rb', line 22 def apply_to_Include(element) fname = search_file(element.filename, element.tree.include_paths, @include_suffix) File.readlines(fname).join("") if fname end |