Class: IRuby::Display::RespondToFormatMatcher
- Inherits:
-
FormatMatcher
- Object
- FormatMatcher
- IRuby::Display::RespondToFormatMatcher
- Defined in:
- lib/iruby/display.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ RespondToFormatMatcher
constructor
A new instance of RespondToFormatMatcher.
- #inspect ⇒ Object
Methods inherited from FormatMatcher
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
220 221 222 |
# File 'lib/iruby/display.rb', line 220 def name @name end |
Instance Method Details
#inspect ⇒ Object
222 223 224 |
# File 'lib/iruby/display.rb', line 222 def inspect "#{self.class.name}[respond_to?(%p)]" % name end |