eval.in

Paste #147

Ruby — MRI 1.9.3, pasted 4 years ago

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
class Greeter
  def initialize(name)
    @name = name
  end

  def greet
    puts "Hello #{@name}!"
  end
end

greeter = Greeter.new "Charlie"
greeter.greet

Program Output

Hello Charlie!

OK (0.012 sec real, 0.013 sec wall, 7 MB, 22 syscalls)

Fork