Class: IRuby::Display::FormatMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/iruby/display.rb

Direct Known Subclasses

RespondToFormatMatcher, TypeFormatMatcher

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ FormatMatcher

Returns a new instance of FormatMatcher.



201
202
203
# File 'lib/iruby/display.rb', line 201

def initialize(&block)
  @block = block
end

Instance Method Details

#call(obj) ⇒ Object



205
206
207
# File 'lib/iruby/display.rb', line 205

def call(obj)
  @block.(obj)
end

#inspectObject



209
210
211
# File 'lib/iruby/display.rb', line 209

def inspect
  "#{self.class.name}[%p]" % @block
end