Class: RSpec::Signal::Backtrace::Frame

Inherits:
Struct
  • Object
show all
Defined in:
lib/rspec/signal/backtrace/frame.rb,
lib/rspec/signal/backtrace/reducer.rb

Overview

Frames and gaps are rendered side by side, so both answer frame?.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#display_pathObject

Returns the value of attribute display_path

Returns:

  • (Object)

    the current value of display_path



12
13
14
# File 'lib/rspec/signal/backtrace/frame.rb', line 12

def display_path
  @display_path
end

#gem_nameObject

Returns the value of attribute gem_name

Returns:

  • (Object)

    the current value of gem_name



12
13
14
# File 'lib/rspec/signal/backtrace/frame.rb', line 12

def gem_name
  @gem_name
end

#kindObject

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



12
13
14
# File 'lib/rspec/signal/backtrace/frame.rb', line 12

def kind
  @kind
end

#labelObject

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



12
13
14
# File 'lib/rspec/signal/backtrace/frame.rb', line 12

def label
  @label
end

#lineObject

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



12
13
14
# File 'lib/rspec/signal/backtrace/frame.rb', line 12

def line
  @line
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



12
13
14
# File 'lib/rspec/signal/backtrace/frame.rb', line 12

def path
  @path
end

#rawObject

Returns the value of attribute raw

Returns:

  • (Object)

    the current value of raw



12
13
14
# File 'lib/rspec/signal/backtrace/frame.rb', line 12

def raw
  @raw
end

Instance Method Details

#external?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/rspec/signal/backtrace/frame.rb', line 17

def external?
  kind == :external
end

#frame?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/rspec/signal/backtrace/reducer.rb', line 26

def frame?
  true
end

#framework?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/rspec/signal/backtrace/frame.rb', line 21

def framework?
  kind == :framework
end

#locationObject



25
26
27
# File 'lib/rspec/signal/backtrace/frame.rb', line 25

def location
  line ? "#{display_path}:#{line}" : display_path
end

#project?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/rspec/signal/backtrace/frame.rb', line 13

def project?
  kind == :project
end

#to_hObject



33
34
35
# File 'lib/rspec/signal/backtrace/frame.rb', line 33

def to_h
  { location: location, label: label, kind: kind.to_s, gem: gem_name }.compact
end

#to_sObject



29
30
31
# File 'lib/rspec/signal/backtrace/frame.rb', line 29

def to_s
  label && !label.empty? ? "#{location} in `#{label}'" : location
end