Module: Unsorted
- Defined in:
- lib/unsorted.rb,
lib/unsorted/version.rb
Constant Summary collapse
- VERSION =
"0.0.1"
Class Method Summary collapse
Class Method Details
.check_argument_validity?(input) ⇒ Boolean
10 11 12 |
# File 'lib/unsorted.rb', line 10 def self.check_argument_validity?(input) input.is_a? Integer end |
.grab(size) ⇒ Object
4 5 6 7 8 |
# File 'lib/unsorted.rb', line 4 def self.grab(size) raise ArgumentError, "only integers are allowed as input" unless check_argument_validity?(size) unsorted = (1..size).to_a.shuffle end |