Condicionales

if conditional [then]
          code...
[elsif conditional [then]
          code...]...
[else
          code...]
end

case value
when expression1
  #do something
when expression2
  #do something
...
when expressionN
  #do something
else
  #do default case
end

honda  = ['honda', 'acura', 'civic', 'element', 'fit', ...]
toyota = ['toyota', 'lexus', 'tercel', 'rx', 'yaris', ...]
...

if include_concept_cars:
  honda += ['ev-ster', 'concept c', 'concept s', ...]
  ...

case car
when *toyota
  # Do something for Toyota cars
when *honda
  # Do something for Honda cars
...
end


Casiano Rodriguez León 2015-06-18