Sha256: a96e37a9a97ed7ce12d7219cf04fa8642bfbe64bcd97818465ee60fd27272b80

Contents?: true

Size: 182 Bytes

Versions: 11

Compression:

Stored size: 182 Bytes

Contents

class RequiredField
  def validate(form, key)
    return if form[key] and not( form[key].empty?)
    form.invalid(key, RequiredFieldError.new)
  end
end

class RequiredFieldError
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
starapor-slippers-0.0.2 examples/forms/model/registration_rules/required_field.rb
starapor-slippers-0.0.3 examples/forms/model/registration_rules/required_field.rb
starapor-slippers-0.0.5 examples/forms/model/registration_rules/required_field.rb
starapor-slippers-0.0.6 examples/forms/model/registration_rules/required_field.rb
starapor-slippers-0.0.8 examples/forms/model/registration_rules/required_field.rb
starapor-slippers-0.0.9 examples/forms/model/registration_rules/required_field.rb
slippers-0.0.14 examples/forms/model/registration_rules/required_field.rb
slippers-0.0.13 examples/forms/model/registration_rules/required_field.rb
slippers-0.0.12 examples/forms/model/registration_rules/required_field.rb
slippers-0.0.11 examples/forms/model/registration_rules/required_field.rb
slippers-0.0.10 examples/forms/model/registration_rules/required_field.rb