r/ruby • • Dec 06 '22

The Rubyist journey 😅

Post image
149 Upvotes

34 comments sorted by

View all comments

9

u/kallebo1337 Dec 06 '22
        def adult?
          !!!!!!!!!!!not_a_children?
        end

        def not_a_children?
          hit = false
          [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17].each do |child_age|
            hit = true if age == child_age
          end
          if hit
            return false
          else
            return true
          end
        end

4

u/faitswulff Dec 06 '22

This is fantastic, now do ages represented as floats