module ActiveModel::Validations::HelperMethods

def validates_inclusion_of(*attr_names)

See ActiveModel::Validations#validates for more information
+:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+.
There is also a list of default options supported by every validator:

not included in the list").
* :message - Specifies a custom error message (default is: "is
* :within - A synonym(or alias) for :in
a proc or lambda the instance under validation is passed as an argument.
with Range#cover?, otherwise with include?. When using
enumerable is a numerical, time or datetime range the test is performed
supplied as a proc, lambda or symbol which returns an enumerable. If the
* :in - An enumerable object of available items. This can be
Configuration options:

end
validates_inclusion_of :karma, in: :available_karmas
validates_inclusion_of :states, in: ->(person) { STATES[person.country] }
validates_inclusion_of :format, in: %w( jpg gif png ), message: "extension %{value} is not included in the list"
validates_inclusion_of :age, in: 0..99
validates_inclusion_of :gender, in: %w( m f )
class Person < ActiveRecord::Base

particular enumerable object.
Validates whether the value of the specified attribute is available in a
def validates_inclusion_of(*attr_names)
  validates_with InclusionValidator, _merge_attributes(attr_names)
end