Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #7284

how to get access to the comparison passed

Newsgroups comp.lang.ruby
Date 2016-08-29 07:49 -0700
Message-ID <fb2a2517-8e96-4f9d-bc28-e42722176626@googlegroups.com> (permalink)
Subject how to get access to the comparison passed
From Mario Ruiz <tcblues@gmail.com>

Show all headers | View raw


If I have a method like this:

def my_method(comp)
 #I know this is not working but to understand what I want
 puts comp.to_s
 return comp
end


my_method(4==6)
# my_method will return false and print out 4==6

b=7
c=9
life=false
my_method(b<456)
#my_method will return true and print out b<456

my_method(c>=b)
#my_method will return true and print out c>=b

my_method(life)
#my_method will return false and print out life

is that possible?

Back to comp.lang.ruby | Previous | NextNext in thread | Find similar


Thread

how to get access to the comparison passed Mario Ruiz <tcblues@gmail.com> - 2016-08-29 07:49 -0700
  Re: how to get access to the comparison passed Robert Klemme <shortcutter@googlemail.com> - 2016-08-29 21:42 +0200
    Re: how to get access to the comparison passed Mario Ruiz <tcblues@gmail.com> - 2016-08-30 05:48 -0700

csiph-web