Sha256: 428aad4259808cbc6d795839e547b4fdb98b63ddb817d4f5d86c6e318e78e850

Contents?: true

Size: 490 Bytes

Versions: 9

Compression:

Stored size: 490 Bytes

Contents

module MxitRails
  class Validations

    def self.not_blank? input
      return !input.blank?
    end

    def self.numeric? input
      return !input.blank? && input.match(/^[0-9]+$/)
    end

    def self.length? input, len
      return !input.blank? && (input.length == len)
    end

    def self.min_length? input, max
      return !input.blank? && (input.length >= max)
    end

    def self.max_length? input, max
      return input.blank? || (input.length <= max)
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mxit-rails-0.2.3 lib/mxit_rails/validations.rb
mxit-rails-0.2.2 lib/mxit_rails/validations.rb
mxit-rails-0.2.1 lib/mxit_rails/validations.rb
mxit-rails-0.2.0 lib/mxit_rails/validations.rb
mxit-rails-0.1.4 lib/mxit_rails/validations.rb
mxit-rails-0.1.2 lib/mxit_rails/validations.rb
mxit-rails-0.1.1 lib/mxit_rails/validations.rb
mxit-rails-0.1.0 lib/mxit_rails/validations.rb
mxit-rails-0.0.9 lib/mxit_rails/validations.rb