Hi!
there is a better way to do that?
if anArray.include?(id)
state=‘YES’
else
state=‘NOT’
end
puts “#{id}: #{state} included”
Thanks!
Hi!
there is a better way to do that?
if anArray.include?(id)
state=‘YES’
else
state=‘NOT’
end
puts “#{id}: #{state} included”
Thanks!
Farrel L. wrote:
state = anArray.include?(id) ? ‘YES’ : ‘NO’
Oh! Im an idiot!
Thanks a lot!!!
2008/12/2 Fernando G. [email protected]:
if anArray.include?(id)
state=‘YES’
else
state=‘NOT’
end
state = if anArray.include?(id)
‘YES’
else
‘NO’
end
or
state = anArray.include?(id) ? ‘YES’ : ‘NO’
Aimred - Ruby Development and Consulting
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs