summaryrefslogtreecommitdiff
path: root/lib/highline
diff options
context:
space:
mode:
authorAbinoam P. Marques Jr <abinoam@gmail.com>2017-07-07 05:24:23 -0300
committerAbinoam P. Marques Jr <abinoam@gmail.com>2017-07-07 05:31:51 -0300
commit8e9b826acfe47b049b3376ea1b2b9fd51c60e2e0 (patch)
tree2e685caea0f5067d7f260bd596f9c264b203bc85 /lib/highline
parent653dd52f6f8a90d3a43cdd0a76d6221050b9d3f4 (diff)
downloadhighline-8e9b826acfe47b049b3376ea1b2b9fd51c60e2e0.tar.gz
Use guard clauses (rubocop warning)
Diffstat (limited to 'lib/highline')
-rw-r--r--lib/highline/menu.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/highline/menu.rb b/lib/highline/menu.rb
index b1205d8..5f73cd7 100644
--- a/lib/highline/menu.rb
+++ b/lib/highline/menu.rb
@@ -269,11 +269,11 @@ class HighLine
def index=(style)
@index = style
+ return unless @index == :none || @index.is_a?(::String)
+
# Default settings.
- if @index == :none || @index.is_a?(::String)
- @index_suffix = " "
- @select_by = :name
- end
+ @index_suffix = " "
+ @select_by = :name
end
#