Class: IRuby::Display::RespondToFormatMatcher

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from FormatMatcher

#call

Constructor Details

#initialize(name) ⇒ RespondToFormatMatcher

Returns a new instance of RespondToFormatMatcher.



215
216
217
218
# File 'lib/iruby/display.rb', line 215

def initialize(name)
  super() {|obj| obj.respond_to?(name) }
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



220
221
222
# File 'lib/iruby/display.rb', line 220

def name
  @name
end

Instance Method Details

#inspectObject



222
223
224
# File 'lib/iruby/display.rb', line 222

def inspect
  "#{self.class.name}[respond_to?(%p)]" % name
end