Class: Byebug::Interface
- Inherits:
-
Object
- Object
- Byebug::Interface
- Defined in:
- lib/byebug/interface.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#have_readline ⇒ Object
writeonly
Sets the attribute have_readline.
Instance Method Summary collapse
-
#errmsg(*args) ⇒ Object
Common routine for reporting byebug error messages.
- #escape(msg) ⇒ Object
- #format(*args) ⇒ Object
-
#initialize ⇒ Interface
constructor
A new instance of Interface.
Constructor Details
#initialize ⇒ Interface
Returns a new instance of Interface.
6 7 8 |
# File 'lib/byebug/interface.rb', line 6 def initialize @have_readline = false end |
Instance Attribute Details
#have_readline=(value) ⇒ Object (writeonly)
Sets the attribute have_readline
4 5 6 |
# File 'lib/byebug/interface.rb', line 4 def have_readline=(value) @have_readline = value end |
Instance Method Details
#errmsg(*args) ⇒ Object
Common routine for reporting byebug error messages. Derived classes may want to override this to capture output.
12 13 14 15 |
# File 'lib/byebug/interface.rb', line 12 def errmsg(*args) print '*** ' print(*args) end |
#escape(msg) ⇒ Object
27 28 29 |
# File 'lib/byebug/interface.rb', line 27 def escape(msg) msg.gsub('%', '%%') end |
#format(*args) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/byebug/interface.rb', line 17 def format(*args) if args.is_a?(Array) new_args = args.first new_args = new_args % args[1..-1] unless args[1..-1].empty? else new_args = args end new_args end |