Sha256: 7fdff75c9a9eff29276064d9d680011c087a7dd648ca84cd3003e0944375dc93
Contents?: true
Size: 850 Bytes
Versions: 1
Compression:
Stored size: 850 Bytes
Contents
# frozen_string_literal: true class PlaygroundsController < ApplicationController before_action :set_source def show @source = <<~CODE puts "You can use `puts` to output strings to (fake) stdout for logging." puts "Call multiple absolutely OK!" module Foo class Bar attr_reader :flag def initialize(val) @flag = val end end end var = Foo::Bar.new(false) # try to set `true` if var.flag return "No time to say Hello." end str = "" (1..3).each do |i| str += "Hello world!!! x\#{i}; " end str # In dummy the last line is the return value CODE end def create @result = ScriptEngine.run_inline @source end private def set_source @source = params.fetch(:source, "") end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
script_core-0.1.0 | spec/dummy/app/controllers/playgrounds_controller.rb |