Class: RD::OutputFormatVisitor
- Includes:
- SearchFile
- Defined in:
- lib/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.
-
#input_filename ⇒ Object
Returns the value of attribute input_filename.
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.
17 18 19 20 21 22 |
# File 'lib/rd/output-format-visitor.rb', line 17 def initialize super @include_suffix = self.class::INCLUDE_SUFFIX.clone @filename = nil @input_filename = "-" end |
Instance Attribute Details
#filename ⇒ Object
Returns the value of attribute filename.
14 15 16 |
# File 'lib/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/rd/output-format-visitor.rb', line 13 def include_suffix @include_suffix end |
#input_filename ⇒ Object
Returns the value of attribute input_filename.
15 16 17 |
# File 'lib/rd/output-format-visitor.rb', line 15 def input_filename @input_filename end |
Instance Method Details
#apply_to_Include(element) ⇒ Object
24 25 26 27 28 |
# File 'lib/rd/output-format-visitor.rb', line 24 def apply_to_Include(element) fname = search_file(element.filename, element.tree.include_paths, @include_suffix) File.readlines(fname).join("") if fname end |