Sha256: df3f57d20dd7ffd1de81ed0bc5da0723ef5899534ee14db436daf6f72dcdc824
Contents?: true
Size: 464 Bytes
Versions: 4
Compression:
Stored size: 464 Bytes
Contents
module Trestle class Display def initialize(instance) @instance = instance end 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 private def display_method @display_method ||= Trestle.config.display_methods.find { |m| @instance.respond_to?(m) } end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
trestle-0.8.4 | lib/trestle/display.rb |
trestle-0.8.3 | lib/trestle/display.rb |
trestle-0.8.2 | lib/trestle/display.rb |
trestle-0.8.0 | lib/trestle/display.rb |