类 IRB::Command::Base
属性
irb_context[R]
公共类方法
category(category = nil) 点击切换源代码
# File irb/command/base.rb, line 19 def category(category = nil) @category = category if category @category || "No category" end
description(description = nil) 点击切换源代码
# File irb/command/base.rb, line 24 def description(description = nil) @description = description if description @description || "No description provided." end
execute(irb_context, arg) 点击切换源代码
# File irb/command/base.rb, line 34 def execute(irb_context, arg) new(irb_context).execute(arg) rescue CommandArgumentError => e puts e.message end
help_message(help_message = nil) 点击切换源代码
# File irb/command/base.rb, line 29 def help_message(help_message = nil) @help_message = help_message if help_message @help_message end
new(irb_context) 点击切换源代码
# File irb/command/base.rb, line 47 def initialize(irb_context) @irb_context = irb_context end
私有类方法
highlight(text) 点击切换源代码
# File irb/command/base.rb, line 42 def highlight(text) Color.colorize(text, [:BOLD, :BLUE]) end
公共实例方法
execute(arg) 点击切换源代码
# File irb/command/base.rb, line 53 def execute(arg) #nop end