Class: Fixnum

Inherits:
Object
  • Object
show all
Defined in:
lib/divisible/core_ext.rb

Instance Method Summary collapse

Instance Method Details

#divisible_by(*args) ⇒ Object

DEPRECATED: Please use divisible_by? instead.



11
12
13
14
# File 'lib/divisible/core_ext.rb', line 11

def divisible_by(*args)
  warn "[DEPRECATION] `divisible_by` is deprecated.  Please use `divisible_by?` instead."
  divisible_by?(*args)
end

#divisible_by?(first, *args) ⇒ Boolean

Returns:

  • (Boolean)


2
3
4
5
6
7
8
# File 'lib/divisible/core_ext.rb', line 2

def divisible_by?(first,*args)
  args += [first]
  args.each do |arg|
    return false unless Divisible.check(self, arg)
  end
  true
end