Executing a line of code in a ruby file
Hi,
Is there a way to execute a line of code in a ruby file directly in the editor like textmate does? For example take this code:
{code}
class Point
def self.my_new_instance(*args, &block)
instance = allocate
instance.my_initialize(*args, &block)
instance
end
def my_initialize(x, y)
@x = x
@y = y
end
end
p = Point.my_new_instance(3, 4) # => #<Point:0x007fb0b085f148 @x=3, @y=4>
{code}
I would like to see the last line above spit out what I am showing you after the # is this possible rather than having to run the run button.
Thanks,
Jay
Please sign in to leave a comment.