Class: Bignum

Inherits:
Object
  • Object
show all
Defined in:
lib/fizzbuzz/core/bignum.rb

Overview

Provides a convenient integration of FizzBuzz with Bignum class.

Instance Method Summary collapse

Instance Method Details

#buzz?Boolean

call-seq:

Bignum.buzz? -> true or false

Returns true if a given integer value is divisible by five (given value is a Buzz), or false otherwise.

Example:

1000000000000.buzz?    #=> true
1000000000002.buzz?    #=> false
1000000000005.buzz?    #=> false

See also: FizzBuzz::[] and FizzBuzz::is_buzz?

Returns:

  • (Boolean)


39
40
41
# File 'lib/fizzbuzz/core/bignum.rb', line 39

def buzz?
  FizzBuzz.is_buzz?(self)
end

#fizz?Boolean

call-seq:

Bignum.fizz? -> true or false

Returns true if a given integer value is divisible by three (given value is a Fizz), or false otherwise.

Example:

1000000000000.fizz?    #=> false
1000000000002.fizz?    #=> true
1000000000005.fizz?    #=> false

See also: FizzBuzz::[] and FizzBuzz::is_fizz?

Returns:

  • (Boolean)


20
21
22
# File 'lib/fizzbuzz/core/bignum.rb', line 20

def fizz?
  FizzBuzz.is_fizz?(self)
end

#fizzbuzz?Boolean

call-seq:

Bignum.fizzbuzz? -> true or false

Returns true if a given integer value is divisible by both three and five (given value is a FizzBuzz), or false otherwise.

Example:

1000000000000.fizzbuzz?    #=> false
1000000000002.fizzbuzz?    #=> false
1000000000005.fizzbuzz?    #=> true

See also: FizzBuzz::[] and FizzBuzz::is_fizzbuzz?

Returns:

  • (Boolean)


58
59
60
# File 'lib/fizzbuzz/core/bignum.rb', line 58

def fizzbuzz?
  FizzBuzz.is_fizzbuzz?(self)
end