Class: Stackdo::Frame
- Inherits:
-
Object
- Object
- Stackdo::Frame
- Defined in:
- lib/stackdo.rb
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#method_reference ⇒ Object
readonly
Returns the value of attribute method_reference.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(location:, method_reference:, environment:) ⇒ Frame
constructor
A new instance of Frame.
Constructor Details
#initialize(location:, method_reference:, environment:) ⇒ Frame
Returns a new instance of Frame.
65 66 67 68 69 |
# File 'lib/stackdo.rb', line 65 def initialize(location:, method_reference:, environment:) @location = location @method_reference = method_reference @environment = environment end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
51 52 53 |
# File 'lib/stackdo.rb', line 51 def environment @environment end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
51 52 53 |
# File 'lib/stackdo.rb', line 51 def location @location end |
#method_reference ⇒ Object (readonly)
Returns the value of attribute method_reference.
51 52 53 |
# File 'lib/stackdo.rb', line 51 def method_reference @method_reference end |
Class Method Details
.from_binding(binding) ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/stackdo.rb', line 53 def self.from_binding(binding) file = binding.eval("__FILE__") line = binding.eval("__LINE__") method_name = binding.eval("__method__") Stackdo::Frame.new( location: Location.new(file, line), method_reference: MethodReference.new(binding.receiver, method_name), environment: Environment.from_binding(binding) ) end |