Class: Ruby::Reflection::StackFrameMirror
- Includes:
- AbstractReflection::StackFrameMirror
- Defined in:
- lib/ruby/reflection/stack_frame_mirror.rb
Instance Attribute Summary collapse
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes included from AbstractReflection::Mirror
Instance Method Summary collapse
-
#initialize(obj) ⇒ StackFrameMirror
constructor
A new instance of StackFrameMirror.
- #selector ⇒ Object
- #source_offset ⇒ Object
- #step_offset ⇒ Object
Methods included from AbstractReflection::StackFrameMirror
#arguments, #binding, #ip_offset, #locals, #pop, #receiver, #restart, #self, #step, #variable_context
Methods included from AbstractReflection::Mirror
Methods included from AbstractReflection::Mirror::ClassMethods
#included, #mirror_class, #new, #reflect, #reflect!, #reflects?, #register_mirror
Constructor Details
#initialize(obj) ⇒ StackFrameMirror
Returns a new instance of StackFrameMirror.
10 11 12 13 14 15 16 |
# File 'lib/ruby/reflection/stack_frame_mirror.rb', line 10 def initialize(obj) super @name = obj.method @index = obj.index @method = find_method_for(obj.file, obj.line) @thread = obj.thread end |
Instance Attribute Details
#method ⇒ Object (readonly)
Returns the value of attribute method.
8 9 10 |
# File 'lib/ruby/reflection/stack_frame_mirror.rb', line 8 def method @method end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/ruby/reflection/stack_frame_mirror.rb', line 7 def name @name end |
Instance Method Details
#selector ⇒ Object
29 30 31 |
# File 'lib/ruby/reflection/stack_frame_mirror.rb', line 29 def selector @name end |
#source_offset ⇒ Object
22 23 24 25 26 27 |
# File 'lib/ruby/reflection/stack_frame_mirror.rb', line 22 def source_offset if next_frame = @thread.stack[@index - 1] s = @method.send_offsets[next_frame.name] end s || raise(CapabilitiesExceeded) end |
#step_offset ⇒ Object
18 19 20 |
# File 'lib/ruby/reflection/stack_frame_mirror.rb', line 18 def step_offset @method.step_offsets.index(source_offset) end |