Class: Ree::Contracts::ArgContracts::Nilor

Inherits:
Or
  • Object
show all
Defined in:
lib/ree/contracts/arg_contracts/nilor.rb

Instance Attribute Summary

Attributes inherited from Or

#validators

Instance Method Summary collapse

Methods inherited from Or

#message, #valid?

Methods included from Squarable

#[]

Methods included from Truncatable

#truncate

Constructor Details

#initializeNilor

Returns a new instance of Nilor.



6
7
8
9
# File 'lib/ree/contracts/arg_contracts/nilor.rb', line 6

def initialize(*)
  super
  validators << Validators.fetch_for(nil)
end

Instance Method Details

#to_sObject



11
12
13
# File 'lib/ree/contracts/arg_contracts/nilor.rb', line 11

def to_s
  "Nilor[#{validators[0..-2].map(&:to_s).join(', ')}]"
end