Class: Mirah::Transform::Transformer
- Inherits:
-
Object
- Object
- Mirah::Transform::Transformer
- Defined in:
- lib/mirah/transform/transformer.rb
Defined Under Namespace
Classes: JMetaPosition
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
-
#initialize(state, typer) ⇒ Transformer
constructor
A new instance of Transformer.
- #tmp(format = "__xform_tmp_%d") ⇒ Object
Constructor Details
#initialize(state, typer) ⇒ Transformer
Returns a new instance of Transformer.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/mirah/transform/transformer.rb', line 28 def initialize(state, typer) @errors = [] @tmp_count = 0 @annotations = [] @extra_body = nil @state = state @typer = typer @types = typer.type_system if typer @files = {""=>{:filename => "", :line => 0, :code => ""}} end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
25 26 27 |
# File 'lib/mirah/transform/transformer.rb', line 25 def errors @errors end |
#filename ⇒ Object
Returns the value of attribute filename.
26 27 28 |
# File 'lib/mirah/transform/transformer.rb', line 26 def filename @filename end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
25 26 27 |
# File 'lib/mirah/transform/transformer.rb', line 25 def state @state end |
Instance Method Details
#tmp(format = "__xform_tmp_%d") ⇒ Object
39 40 41 |
# File 'lib/mirah/transform/transformer.rb', line 39 def tmp(format="__xform_tmp_%d") format % [@tmp_count += 1] end |