Class: Is::Property::Validators::OR

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

Direct Known Subclasses

ANY

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ OR

Returns a new instance of OR.

Parameters:



277
278
279
# File 'lib/is/monkey/properties.rb', line 277

def initialize *args
  @args = args
end

Instance Method Details

#===(value) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)


283
284
285
286
287
288
289
290
# File 'lib/is/monkey/properties.rb', line 283

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