Class: Trestle::Display
- Inherits:
-
Object
- Object
- Trestle::Display
- Defined in:
- lib/trestle/display.rb
Instance Method Summary collapse
-
#initialize(instance) ⇒ Display
constructor
A new instance of Display.
- #to_s ⇒ Object
Constructor Details
#initialize(instance) ⇒ Display
Returns a new instance of Display.
3 4 5 |
# File 'lib/trestle/display.rb', line 3 def initialize(instance) @instance = instance end |
Instance Method Details
#to_s ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/trestle/display.rb', line 7 def to_s if display_method != :to_s || @instance.method(display_method).source_location @instance.public_send(display_method) else "#{@instance.class} (##{@instance.id})" end end |