Class: PdfTempura::Document::Validation::InclusionValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/pdf_tempura/document/validation.rb

Instance Method Summary collapse

Instance Method Details

#validate(object, method, values) ⇒ Object

Raises:

  • (ArgumentError)


54
55
56
# File 'lib/pdf_tempura/document/validation.rb', line 54

def validate(object, method, values)
  raise ArgumentError, "#{method.capitalize} must be one of the following values: #{values.join(", ")}." unless values.include?(object.send(method))
end