summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbinoam Praxedes Marques Jr <abinoam@gmail.com>2015-02-24 17:22:38 -0300
committerAbinoam Praxedes Marques Jr <abinoam@gmail.com>2015-02-24 17:29:43 -0300
commite8793abb7de9e95354e305c2245b9578b64defb6 (patch)
tree6bdc61c262053bb4730f6fc766980a02d8d16ba6
parenta4c20e3efa14587c6bf55f2e98ec5d1d56b014ca (diff)
downloadhighline-e8793abb7de9e95354e305c2245b9578b64defb6.tar.gz
Use #to_s for question and menu string conversion. Rubinius compatible.
-rw-r--r--lib/highline/menu.rb2
-rwxr-xr-xlib/highline/question.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/highline/menu.rb b/lib/highline/menu.rb
index 636c1e4..44c41b7 100644
--- a/lib/highline/menu.rb
+++ b/lib/highline/menu.rb
@@ -345,7 +345,7 @@ class HighLine
# Allows Menu to behave as a String, just like Question. Returns the
# _layout_ to be rendered, which is used by HighLine.say().
#
- def to_str( )
+ def to_s( )
case @layout
when :list
'<%= if @header.nil? then '' else "#{@header}:\n" end %>' +
diff --git a/lib/highline/question.rb b/lib/highline/question.rb
index 10a32dc..fa8445a 100755
--- a/lib/highline/question.rb
+++ b/lib/highline/question.rb
@@ -441,7 +441,7 @@ class HighLine
end
# Stringifies the question to be asked.
- def to_str( )
+ def to_s
@question
end