Class: Reform::Form::Forms

Inherits:
Array
  • Object
show all
Includes:
ValidateMethods, Representable::Hash::Collection
Defined in:
lib/reform/form.rb

Overview

DISCUSS: this should be a Form subclass.

Instance Method Summary collapse

Methods included from ValidateMethods

#validate

Constructor Details

#initialize(ary, options) ⇒ Forms

Returns a new instance of Forms.



272
273
274
275
# File 'lib/reform/form.rb', line 272

def initialize(ary, options)
  super(ary)
  @options = options
end

Instance Method Details

#errorsObject



284
285
286
# File 'lib/reform/form.rb', line 284

def errors
  @errors ||= Form::Errors.new(self)
end

#valid?Boolean

TODO: make valid?(errors) the only public method.

Returns:

  • (Boolean)


280
281
282
# File 'lib/reform/form.rb', line 280

def valid?
 res= validate_cardinality & validate_items
end