class Car
def initialize
@state = :parked
end
def speed
return 0 if @state == :parked
20
end
def drive
@state = :driving
end
end
car = Car.new
puts car.speed
car.drive
puts car.speed
Y2xhc3MgQ2FyCglkZWYgaW5pdGlhbGl6ZQoJCUBzdGF0ZSA9IDpwYXJrZWQKCWVuZAoJCglkZWYgc3BlZWQKCQlyZXR1cm4gMCBpZiBAc3RhdGUgPT0gOnBhcmtlZAoJCQoJCTIwCgllbmQKCQoJZGVmIGRyaXZlCgkJQHN0YXRlID0gOmRyaXZpbmcKCWVuZAplbmQKCmNhciA9IENhci5uZXcKcHV0cyBjYXIuc3BlZWQKY2FyLmRyaXZlCnB1dHMgY2FyLnNwZWVk