mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/reline] Define StringWithTiparm instead of singular method
https://github.com/ruby/reline/commit/de234dc875
This commit is contained in:
parent
5b9f3ed326
commit
0f496b9b29
1 changed files with 6 additions and 4 deletions
|
@ -72,12 +72,14 @@ module Reline::Terminfo
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.tigetstr(capname)
|
class StringWithTiparm < String
|
||||||
result = @tigetstr.(capname).to_s
|
def tiparm(*args) # for method chain
|
||||||
def result.tiparm(*args) # for method chain
|
|
||||||
Reline::Terminfo.tiparm(self, *args)
|
Reline::Terminfo.tiparm(self, *args)
|
||||||
end
|
end
|
||||||
result
|
end
|
||||||
|
|
||||||
|
def self.tigetstr(capname)
|
||||||
|
StringWithTiparm.new(@tigetstr.(capname).to_s)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.tiparm(str, *args)
|
def self.tiparm(str, *args)
|
||||||
|
|
Loading…
Reference in a new issue