From f74253844b863c7bcf0003f77f3e146466072aab Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Wed, 25 Jun 2014 14:53:22 -0400 Subject: [PATCH] use .is_a?() instead of .class == --- lib/yawpa.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/yawpa.rb b/lib/yawpa.rb index 4e35ca9..eded2c2 100644 --- a/lib/yawpa.rb +++ b/lib/yawpa.rb @@ -113,7 +113,7 @@ module Yawpa # Condense 1-element arrays of option values to just the element itself opts.each_key do |k| - if opts[k].class == Array and opts[k].length == 1 + if opts[k].is_a?(Array) and opts[k].length == 1 opts[k] = opts[k].first end end @@ -152,7 +152,7 @@ module Yawpa newkey = k.to_s newopts[newkey] = {key: k} nargs = v[:nargs] || 0 - nargs = (nargs..nargs) if nargs.class == Fixnum + nargs = (nargs..nargs) if nargs.is_a?(Fixnum) newopts[newkey][:nargs] = nargs newopts[newkey][:short] = v[:short] || '' end