module Hashie::Extensions::Dash::PredefinedValues::InstanceMethods
def assert_property_values!
def assert_property_values! self.class.values_for_properties.each_key do |property| value = send(property) if value && !values_for_properties(property).include?(value) fail_property_value_error!(property) end end end
def fail_property_value_error!(property)
def fail_property_value_error!(property) raise ArgumentError, "Invalid value for property '#{property}'" end
def initialize(*)
def initialize(*) super assert_property_values! end
def values_for_properties(property)
def values_for_properties(property) self.class.values_for_properties[property] end