Methods

Class Index [+]

Quicksearch

DataMapper::Validations::MethodValidator

@author Guy van den Berg @since 0.9

Public Class Methods

new(field_name, options={}) click to toggle source
    # File lib/dm-validations/validators/method_validator.rb, line 7
 7:       def initialize(field_name, options={})
 8:         super
 9:         @options[:method] = @field_name unless @options.key?(:method)
10:       end

Public Instance Methods

==(other) click to toggle source
    # File lib/dm-validations/validators/method_validator.rb, line 18
18:       def ==(other)
19:         @options[:method] == other.instance_variable_get(:@options)[:method] && super
20:       end
call(target) click to toggle source
    # File lib/dm-validations/validators/method_validator.rb, line 12
12:       def call(target)
13:         result, message = target.__send__(@options[:method])
14:         add_error(target, message, field_name) unless result
15:         result
16:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.