Class: TL1::OutputFormat
- Inherits:
-
Object
- Object
- TL1::OutputFormat
- Defined in:
- lib/tl1/output_format.rb
Overview
A format for records appearing in output messages.
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #as_json ⇒ Object
- #ast ⇒ Object
-
#initialize(source) ⇒ OutputFormat
constructor
A new instance of OutputFormat.
- #parse(record_source) ⇒ Object
Constructor Details
#initialize(source) ⇒ OutputFormat
Returns a new instance of OutputFormat.
7 8 9 |
# File 'lib/tl1/output_format.rb', line 7 def initialize(source) @source = source end |
Instance Attribute Details
#source ⇒ Object (readonly)
Returns the value of attribute source.
5 6 7 |
# File 'lib/tl1/output_format.rb', line 5 def source @source end |
Instance Method Details
#as_json ⇒ Object
15 16 17 |
# File 'lib/tl1/output_format.rb', line 15 def as_json ast.as_json end |
#ast ⇒ Object
11 12 13 |
# File 'lib/tl1/output_format.rb', line 11 def ast @ast ||= AST.(source) end |
#parse(record_source) ⇒ Object
19 20 21 |
# File 'lib/tl1/output_format.rb', line 19 def parse(record_source) ast.parse(record_source) end |