Module: CodeObject::Converter
- Included in:
- Parser::Comment
- Defined in:
- lib/code_object/converter.rb
Overview
here the dependencies to Dom::Node and Parser::Comment should be described
Instance Attribute Summary collapse
-
#code_object ⇒ Object
readonly
Returns the value of attribute code_object.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
Instance Attribute Details
#code_object ⇒ Object (readonly)
Returns the value of attribute code_object.
12 13 14 |
# File 'lib/code_object/converter.rb', line 12 def code_object @code_object end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
12 13 14 |
# File 'lib/code_object/converter.rb', line 12 def path @path end |
Instance Method Details
#to_code_object ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/code_object/converter.rb', line 14 def to_code_object # 1. Create a new CodeObject from Type-Token @code_object = Type.create_matching_object(@tokenlines) or return nil # join all documentation-contents @code_object.docs = @doclines.join '' # move meta-information from comment to code_object # (This includes filepath, source and line_start @code_object.(self) # 2. Process Tokenlines with registered handlers @code_object.process_tokens(@tokenlines) # 3.Continue with all children of this comment and add them as # child nodes convert_children { |child| @code_object.add_node(child) } return @code_object end |