Class: Rum::FileLocation

Inherits:
Object
  • Object
show all
Defined in:
lib/rum/dsl.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, line) ⇒ FileLocation

Returns a new instance of FileLocation.



17
18
19
20
# File 'lib/rum/dsl.rb', line 17

def initialize(file, line)
  @file = file
  @line = line
end

Class Method Details

.from_stack_frame(frame) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/rum/dsl.rb', line 22

def self.from_stack_frame(frame)
  file, line = Rum.parse_stack_frame(frame)
  if file
    file = File.expand_path(file) if File.dirname(file) == '.'
    new(file, line)
  end
end

Instance Method Details

#visitObject



30
31
32
33
# File 'lib/rum/dsl.rb', line 30

def visit
  Gui.open_file(@file, @line)
  true
end