Skip to content

Instantly share code, notes, and snippets.

@emiltin
Created August 7, 2010 23:38
Show Gist options
  • Select an option

  • Save emiltin/513325 to your computer and use it in GitHub Desktop.

Select an option

Save emiltin/513325 to your computer and use it in GitHub Desktop.
class CrazyNum
def div? v,b
"#{v%b==0 ? '' : 'not '}dividable by #{b}"
end
def examine v
puts "The value #{v} is #{div? v,3} and is #{div? v,5}."
end
end
a = CrazyNum.new
1.upto(100) { |x| a.examine x }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment