Exception: SuperModel::Error::InvalidPlurality

Inherits:
SuperModel::Error show all
Defined in:
lib/super_model/error/invalid_plurality.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.check(object) ⇒ Object

Raises:

  • (self)


8
9
10
# File 'lib/super_model/error/invalid_plurality.rb', line 8

def self.check(object)
  raise self unless [:singular, :plural].include?(object)
end

Instance Method Details

#to_sObject



12
13
14
# File 'lib/super_model/error/invalid_plurality.rb', line 12

def to_s
  '`plurality` must be either :singular or :plural'
end