Logic for the :asserted_value parameter
# File lib/bindata/base_primitive.rb, line 229 def _value reading? ? @value : eval_parameter(:asserted_value) end
# File lib/bindata/base_primitive.rb, line 238 def assert! assert_value(snapshot) end
# File lib/bindata/base_primitive.rb, line 242 def assert_value(current_value) expected = eval_parameter(:asserted_value, :value => current_value) if not expected raise ValidityError, "value '#{current_value}' not as expected for #{debug_name}" elsif current_value != expected and expected != true raise ValidityError, "value is '#{current_value}' but " + "expected '#{expected}' for #{debug_name}" end end
Generated with the Darkfish Rdoc Generator 2.