diff options
author | aycabta <[email protected]> | 2021-06-24 18:04:02 +0900 |
---|---|---|
committer | aycabta <[email protected]> | 2021-07-30 02:27:02 +0900 |
commit | 0f496b9b29a38cfe39710c96111549d387f73321 (patch) | |
tree | 75fcff66115a8ce612910cf916086cada2fc7bba /lib/reline | |
parent | 5b9f3ed326ee24ecdd8986f71cbecea892f386b6 (diff) |
[ruby/reline] Define StringWithTiparm instead of singular method
https://github.com/ruby/reline/commit/de234dc875
Diffstat (limited to 'lib/reline')
-rw-r--r-- | lib/reline/terminfo.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/reline/terminfo.rb b/lib/reline/terminfo.rb index 53809c4937..5c881a375c 100644 --- a/lib/reline/terminfo.rb +++ b/lib/reline/terminfo.rb @@ -72,12 +72,14 @@ module Reline::Terminfo end end - def self.tigetstr(capname) - result = @tigetstr.(capname).to_s - def result.tiparm(*args) # for method chain + class StringWithTiparm < String + def tiparm(*args) # for method chain Reline::Terminfo.tiparm(self, *args) end - result + end + + def self.tigetstr(capname) + StringWithTiparm.new(@tigetstr.(capname).to_s) end def self.tiparm(str, *args) |