Skip to content

Commit 5b6f03f

Browse files
author
Oleg Sukhodolsky
committed
Let's use SimpleDelegator to delegates calls to Printer
1 parent a266fd2 commit 5b6f03f

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

lib/ruby-debug-ide/command.rb

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
require 'ruby-debug-ide/helper'
2+
require 'delegate'
23

34
module Debugger
45

5-
class Command # :nodoc:
6+
class Command < SimpleDelegator # :nodoc:
67
SubcmdStruct=Struct.new(:name, :min, :short_help, :long_help) unless
78
defined?(SubcmdStruct)
89

@@ -67,6 +68,7 @@ def options
6768

6869
def initialize(state, printer)
6970
@state, @printer = state, printer
71+
super @printer
7072
end
7173

7274
def match(input)
@@ -75,15 +77,6 @@ def match(input)
7577

7678
protected
7779

78-
def method_missing(meth, *args, &block)
79-
if @printer.respond_to? meth
80-
@printer.send meth, *args, &block
81-
else
82-
super
83-
end
84-
end
85-
86-
# FIXME: use delegate?
8780
def errmsg(*args)
8881
@printer.print_error(*args)
8982
end

0 commit comments

Comments
 (0)