Z
Zhenning Guan
def ss(s = 'hello', yeah = nil)
if yeah
puts "something"
else
puts "other thing"
end
#code continue ....
end
I have this method, use it like that:
ss('hi', yeah = true)
ss('hello')
ss('****', yeah = true)
ss('hello',yeah = true)
very ugly.. sometimes I just need to passed yeah = true, but I have to
added 'hello' first.
what should I do?
if yeah
puts "something"
else
puts "other thing"
end
#code continue ....
end
I have this method, use it like that:
ss('hi', yeah = true)
ss('hello')
ss('****', yeah = true)
ss('hello',yeah = true)
very ugly.. sometimes I just need to passed yeah = true, but I have to
added 'hello' first.
what should I do?