Sha256: 9a11c33ef803dccb92ca5b5dedecc298b8f1b98615cd433b61c130c8b3365e04

Contents?: true

Size: 618 Bytes

Versions: 2

Compression:

Stored size: 618 Bytes

Contents

module Fluffery
  module Forms
    module Validation
      
      class Presence < Fluffery::Forms::Validation::Base        
        def self.create(attribute ,options)
          options.merge!('required' => 'required') unless options.has_key?('required') && options['required'] === false          
          options
        end        
      end
      
      class Pattern < Fluffery::Forms::Validation::Base
        def self.create(attribute, options, matcher)
          options.reverse_merge!('pattern' => matcher.inspect) unless matcher.nil?
          options
        end        
      end
      
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fluffery-0.0.2 lib/fluffery/forms/validation/validators.rb
fluffery-0.0.1 lib/fluffery/forms/validation/validators.rb