dm-validations/lib/dm-validations.rb
def create_context_instance_methods(context)
          name = "valid_for_#{context.to_s}?"
          if !self.instance_methods.include?(name)
            class_eval <<-EOS
              def #{name}
                valid?('#{context.to_s}'.to_sym)
              end
            EOS
          end
          
          all = "all_valid_for_#{context.to_s}?"
          if !self.instance_methods.include?(all)
            class_eval <<-EOS
              def #{all}
                all_valid?('#{context.to_s}'.to_sym)
              end
            EOS
          end
        end
# Given a new context create an instance method of 
# valid_for_<context>? which simply calls valid?(context)
# if it does not already exist
#
Given a new context create an instance method of
valid_for_. which simply calls valid?(context)
if it does not already exist
Given a new context create an instance method of valid_for_ . which simply calls valid? ( context ) if it does not already exist
def create_context_instance_methods(context)
          name = "valid_for_#{context.to_s}?"
          if !self.instance_methods.include?(name)
            class_eval <<-EOS
              def #{name}
                valid?('#{context.to_s}'.to_sym)
              end
            EOS
          end
          all = "all_valid_for_#{context.to_s}?"
          if !self.instance_methods.include?(all)
            class_eval <<-EOS
              def #{all}
                all_valid?('#{context.to_s}'.to_sym)
              end
            EOS
          end
        end
def create_context_instance_methods ( context ) name = "valid_for_#{context.to_s}?" if ! self . instance_methods . include? ( name ) class_eval <<-EOS 
              def  #{ name } 
                valid?(' #{ context . to_s } '.to_sym)
              end
             EOS end all = "all_valid_for_#{context.to_s}?" if ! self . instance_methods . include? ( all ) class_eval <<-EOS 
              def  #{ all } 
                all_valid?(' #{ context . to_s } '.to_sym)
              end
             EOS end end
Given a new context create an instance method of
valid_for_<context>?
Given a new context create an instance method of valid_for_<context > ?
context