Class: IRuby::Display::TypeFormatMatcher
- Inherits:
-
FormatMatcher
- Object
- FormatMatcher
- IRuby::Display::TypeFormatMatcher
- Defined in:
- lib/iruby/display.rb
Instance Method Summary collapse
-
#initialize(class_block) ⇒ TypeFormatMatcher
constructor
A new instance of TypeFormatMatcher.
- #inspect ⇒ Object
- #klass ⇒ Object
Methods inherited from FormatMatcher
Constructor Details
#initialize(class_block) ⇒ TypeFormatMatcher
Returns a new instance of TypeFormatMatcher.
228 229 230 231 232 233 234 235 236 237 238 |
# File 'lib/iruby/display.rb', line 228 def initialize(class_block) super() do |obj| begin self.klass === obj # We have to rescue all exceptions since constant autoloading could fail with a different error rescue Exception false end end @class_block = class_block end |
Instance Method Details
#inspect ⇒ Object
244 245 246 247 248 249 250 251 |
# File 'lib/iruby/display.rb', line 244 def inspect klass = begin @class_block.() rescue Exception @class_block end "#{self.class.name}[%p]" % klass end |
#klass ⇒ Object
240 241 242 |
# File 'lib/iruby/display.rb', line 240 def klass @class_block.() end |