KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Is there a built-in way or a more elegant way of restricting a number num to upper/lower bounds in Ruby or in Rails? e.g. something like: def number_bounded (num, lower_bound, upper_bound) return lower_bound if num < lower_bound return upper_bound if num > upper_bound num end
Tags (comma-separated)
Save Edits
Cancel