Class: Membrane::Schema::Bool
Constant Summary collapse
- TRUTH_VALUES =
Set.new([true, false])
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#validate(object) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/membrane/schema/bool.rb', line 14 def validate(object) if !TRUTH_VALUES.include?(object) emsg = "Expected instance of true or false, given #{object}" raise Membrane::SchemaValidationError.new(emsg) end end |