Class: TL1::InputFormat
- Inherits:
-
Object
- Object
- TL1::InputFormat
- Defined in:
- lib/tl1/input_format.rb
Overview
A format for an input message.
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #as_json ⇒ Object
- #ast ⇒ Object
- #format(**kwargs) ⇒ Object
-
#initialize(source) ⇒ InputFormat
constructor
A new instance of InputFormat.
Constructor Details
#initialize(source) ⇒ InputFormat
Returns a new instance of InputFormat.
7 8 9 |
# File 'lib/tl1/input_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/input_format.rb', line 5 def source @source end |
Instance Method Details
#as_json ⇒ Object
15 16 17 |
# File 'lib/tl1/input_format.rb', line 15 def as_json ast.as_json end |
#ast ⇒ Object
11 12 13 |
# File 'lib/tl1/input_format.rb', line 11 def ast @ast ||= AST.(source) end |
#format(**kwargs) ⇒ Object
19 20 21 |
# File 'lib/tl1/input_format.rb', line 19 def format(**kwargs) ast.format(**kwargs) end |