Class: Metal::Generator::Action
- Inherits:
-
Object
- Object
- Metal::Generator::Action
- Defined in:
- lib/metal/generator.rb
Instance Method Summary collapse
- #generate(ctx, source) ⇒ Object
-
#initialize(code) ⇒ Action
constructor
A new instance of Action.
- #preprocess(ctx) ⇒ Object
Constructor Details
#initialize(code) ⇒ Action
Returns a new instance of Action.
401 402 403 |
# File 'lib/metal/generator.rb', line 401 def initialize(code) @code = code end |
Instance Method Details
#generate(ctx, source) ⇒ Object
405 406 407 408 |
# File 'lib/metal/generator.rb', line 405 def generate(ctx, source) code, code_len = Generator.escape_quoated_string(@code) source << "ctx->act_run(env,\"#{code}\",#{code_len});\n" end |
#preprocess(ctx) ⇒ Object
404 |
# File 'lib/metal/generator.rb', line 404 def preprocess(ctx) end |