--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: "Validate using the given method. The method given needs to return: [result::&lt;Boolean&gt;, Error Message::&lt;String&gt;]"
- !ruby/struct:SM::Flow::P 
  body: "@example [Usage]"
- !ruby/struct:SM::Flow::VERB 
  body: "  require 'dm-validations'\n\n  class Page\n    include DataMapper::Resource\n\n    property :zip_code, String\n\n    validates_with_method :in_the_right_location?\n\n    def in_the_right_location?\n      if @zip_code == &quot;94301&quot;\n        return true\n      else\n        return [false, &quot;You're in the wrong zip code&quot;]\n      end\n    end\n\n    # A call to valid? will return false and\n    # populate the object's errors with &quot;You're in the\n    # wrong zip code&quot; unless zip_code == &quot;94301&quot;\n\n    # You can also specify field:\n\n    validates_with_method :zip_code, :in_the_right_location?\n\n    # it will add returned error message to :zip_code field\n"
full_name: DataMapper::Validate::ValidatesWithMethod#validates_with_method
is_singleton: false
name: validates_with_method
params: (*fields)
visibility: public
