Class: Is::Property::Validators::ONE

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

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ ONE

Returns a new instance of ONE.

Parameters:



338
339
340
341
# File 'lib/is/monkey/properties.rb', line 338

def initialize *args
  @or = OR.new *args
  @and = AND.new *args
end

Instance Method Details

#===(value) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)


345
346
347
# File 'lib/is/monkey/properties.rb', line 345

def === value
  @or === value && !(@and === value)
end