ValidationMatcher
@private
# File lib/shoulda/matchers/active_model/ensure_inclusion_of_matcher.rb, line 264 def allow_blank(allow_blank = true) @options[:allow_blank] = allow_blank self end
# File lib/shoulda/matchers/active_model/ensure_inclusion_of_matcher.rb, line 269 def allow_nil(allow_nil = true) @options[:allow_nil] = allow_nil self end
# File lib/shoulda/matchers/active_model/ensure_inclusion_of_matcher.rb, line 292 def description "ensure inclusion of #{@attribute} in #{inspect_message}" end
# File lib/shoulda/matchers/active_model/ensure_inclusion_of_matcher.rb, line 252 def in_array(array) @array = array self end
# File lib/shoulda/matchers/active_model/ensure_inclusion_of_matcher.rb, line 257 def in_range(range) @range = range @minimum = range.first @maximum = range.max self end
# File lib/shoulda/matchers/active_model/ensure_inclusion_of_matcher.rb, line 296 def matches?(subject) super(subject) if @range @low_message ||= :inclusion @high_message ||= :inclusion matches_for_range? elsif @array if matches_for_array? true else @failure_message = "#{@array} doesn't match array in validation" false end end end
# File lib/shoulda/matchers/active_model/ensure_inclusion_of_matcher.rb, line 287 def with_high_message(message) @high_message = message if message self end
Generated with the Darkfish Rdoc Generator 2.