module IRuby::Display::Registry
Public Instance Methods
Source
# File lib/iruby/display.rb, line 304 def format(mime = nil, &block) renderer << Renderer.new(@match, mime, block, @priority) renderer.sort_by! { |r| -r.priority } # Decrease priority implicitly for all formats # which are added later for a type. # Overwrite with the `priority` method! @priority -= 1 nil end
Source
# File lib/iruby/display.rb, line 281 def match(&block) @match = FormatMatcher.new(&block) priority 0 nil end
Source
# File lib/iruby/display.rb, line 287 def respond_to(name) @match = RespondToFormatMatcher.new(name) priority 0 nil end
Source
# File lib/iruby/display.rb, line 293 def type(&block) @match = TypeFormatMatcher.new(block) priority 0 nil end