Class: RubyJard::Frame
- Inherits:
-
Object
- Object
- RubyJard::Frame
- Defined in:
- lib/ruby_jard/frame.rb
Overview
This class is a wrapper for Byebug::Frame. This class prevents direct access to Byebug’s internal data structure, provides some more helpers and make Jard easier to test.
Instance Attribute Summary collapse
-
#real_pos ⇒ Object
readonly
Returns the value of attribute real_pos.
-
#virtual_pos ⇒ Object
Returns the value of attribute virtual_pos.
-
#visible ⇒ Object
writeonly
Sets the attribute visible.
Instance Method Summary collapse
- #c_frame? ⇒ Boolean
- #frame_binding ⇒ Object
- #frame_class ⇒ Object
- #frame_file ⇒ Object
- #frame_line ⇒ Object
- #frame_location ⇒ Object
- #frame_method ⇒ Object
- #frame_self ⇒ Object
- #hidden? ⇒ Boolean
-
#initialize(context, real_pos, virtual_pos: nil) ⇒ Frame
constructor
A new instance of Frame.
- #thread ⇒ Object
- #visible? ⇒ Boolean
Constructor Details
#initialize(context, real_pos, virtual_pos: nil) ⇒ Frame
Returns a new instance of Frame.
13 14 15 16 17 18 19 |
# File 'lib/ruby_jard/frame.rb', line 13 def initialize(context, real_pos, virtual_pos: nil) @context = context @real_pos = real_pos @virtual_pos = virtual_pos @visible = true end |
Instance Attribute Details
#real_pos ⇒ Object (readonly)
Returns the value of attribute real_pos.
9 10 11 |
# File 'lib/ruby_jard/frame.rb', line 9 def real_pos @real_pos end |
#virtual_pos ⇒ Object
Returns the value of attribute virtual_pos.
11 12 13 |
# File 'lib/ruby_jard/frame.rb', line 11 def virtual_pos @virtual_pos end |
#visible=(value) ⇒ Object (writeonly)
Sets the attribute visible
10 11 12 |
# File 'lib/ruby_jard/frame.rb', line 10 def visible=(value) @visible = value end |
Instance Method Details
#c_frame? ⇒ Boolean
60 61 62 |
# File 'lib/ruby_jard/frame.rb', line 60 def c_frame? frame_binding.nil? end |
#frame_binding ⇒ Object
52 53 54 |
# File 'lib/ruby_jard/frame.rb', line 52 def frame_binding @context.frame_binding(@real_pos) end |
#frame_class ⇒ Object
48 49 50 |
# File 'lib/ruby_jard/frame.rb', line 48 def frame_class @context.frame_class(@real_pos) end |
#frame_file ⇒ Object
29 30 31 |
# File 'lib/ruby_jard/frame.rb', line 29 def frame_file @context.frame_file(@real_pos) end |
#frame_line ⇒ Object
33 34 35 |
# File 'lib/ruby_jard/frame.rb', line 33 def frame_line @context.frame_line(@real_pos) end |
#frame_location ⇒ Object
37 38 39 40 41 42 |
# File 'lib/ruby_jard/frame.rb', line 37 def frame_location frame_backtrace = @context.backtrace[@real_pos] return nil if frame_backtrace.nil? frame_backtrace.first end |
#frame_method ⇒ Object
56 57 58 |
# File 'lib/ruby_jard/frame.rb', line 56 def frame_method @context.frame_method(@real_pos) end |
#frame_self ⇒ Object
44 45 46 |
# File 'lib/ruby_jard/frame.rb', line 44 def frame_self @context.frame_self(@real_pos) end |
#hidden? ⇒ Boolean
25 26 27 |
# File 'lib/ruby_jard/frame.rb', line 25 def hidden? @visible == false end |
#thread ⇒ Object
64 65 66 |
# File 'lib/ruby_jard/frame.rb', line 64 def thread @context.thread end |
#visible? ⇒ Boolean
21 22 23 |
# File 'lib/ruby_jard/frame.rb', line 21 def visible? @visible == true end |