Class: Is::Property::Validators::AND

Inherits:
Object
  • Object
show all
Defined in:
lib/is/monkey/properties.rb

Direct Known Subclasses

ALL

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ AND

Returns a new instance of AND.

Parameters:



297
298
299
# File 'lib/is/monkey/properties.rb', line 297

def initialize *args
  @args = args
end

Instance Method Details

#===(value) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)


303
304
305
306
307
308
309
310
# File 'lib/is/monkey/properties.rb', line 303

def === value
  @args.each do |v|
    if !(v === value)
      return false
    end
  end
  return true
end