class A1447llMiniTest::MyClass
Public Instance Methods
check_number?(value)
click to toggle source
# File lib/a1447ll_mini_test.rb, line 9 def check_number? (value) (1000..9999).include? value and value%2 == 0 end
divide(a, b)
click to toggle source
# File lib/a1447ll_mini_test.rb, line 17 def divide (a, b) a / b end
enough_length?(string)
click to toggle source
# File lib/a1447ll_mini_test.rb, line 13 def enough_length? (string) (3..8).include? string.length end
fizz_buzz(value)
click to toggle source
# File lib/a1447ll_mini_test.rb, line 21 def fizz_buzz (value) if value%15 == 0 "FizzBuzz" elsif value%3 == 0 "Fizz" elsif value%5 == 0 "Buzz" end end
hello(string)
click to toggle source
# File lib/a1447ll_mini_test.rb, line 31 def hello (string) name = string.split.map{|word| word.capitalize}.join(' ') "Hello, " + name + "!" end
odd?(value)
click to toggle source
# File lib/a1447ll_mini_test.rb, line 5 def odd? (value) value%2 == 1 end