Class: Readapt::Variable
- Inherits:
-
Object
- Object
- Readapt::Variable
- Defined in:
- lib/readapt/variable.rb
Overview
Data retrieved from variable reference in the debugger.
Instance Attribute Summary collapse
- #name ⇒ String readonly
Instance Method Summary collapse
-
#initialize(name, object) ⇒ Variable
constructor
A new instance of Variable.
- #reference ⇒ Integer
- #type ⇒ String
- #value ⇒ String
Constructor Details
#initialize(name, object) ⇒ Variable
Returns a new instance of Variable.
12 13 14 15 |
# File 'lib/readapt/variable.rb', line 12 def initialize name, object @name = name @object = object end |
Instance Attribute Details
#name ⇒ String (readonly)
8 9 10 |
# File 'lib/readapt/variable.rb', line 8 def name @name end |
Instance Method Details
#reference ⇒ Integer
18 19 20 |
# File 'lib/readapt/variable.rb', line 18 def reference @reference ||= unstructured || References.identify(object) end |
#type ⇒ String
34 35 36 |
# File 'lib/readapt/variable.rb', line 34 def type object.class.to_s end |
#value ⇒ String
23 24 25 26 27 28 29 30 31 |
# File 'lib/readapt/variable.rb', line 23 def value @value ||= if object.nil? 'nil' elsif show_class_for_value? "#{empty? ? 'Empty ' : ''}#{object.class}" else object.to_s end end |