lib/formalizer/formalizer.rb
# Adds a form source (path or html) to the forms hash
# Validates that the id is unique
# * +form_id+ - a unique id to the form
# * +form_hash+ - a hash containing form path/html and tags
Adds a form source (path or html) to the forms hash
Validates that the id is unique
+form_id+ - a unique id to the form
+form_hash+ - a hash containing form path/html and tags
Adds a form source ( path or html ) to the forms hash Validates that the id is unique + form_id + - a unique id to the form + form_hash + - a hash containing form path / html and tags
def add_form form_id, form_hash
    raise NotUniqueId unless @form_sources[form_id].nil?
    raise TypeError, 'form_hash should be Hash' unless (form_hash.is_a?Hash)
    raise Formalizer::PathOrHtmlRequired, 'form_hash[:path] required' if form_hash[:path].nil?
    @form_sources[form_id] = form_hash[:path]
    add_tags :forms, form_hash
    true
  end
def add_form form_id , form_hash raise NotUniqueId unless @form_sources [ form_id ] . nil? raise TypeError , 'form_hash should be Hash' unless ( form_hash . is_a? Hash ) raise Formalizer :: PathOrHtmlRequired , 'form_hash[:path] required' if form_hash [ :path ] . nil? @form_sources [ form_id ] = form_hash [ :path ] add_tags :forms , form_hash true end
Adds a form source (path or html) to the forms hash
Validates that the id is unique
 +form_id+ - a unique id to the form
 +form_hash+ - a hash containing form path/html and tags
Adds a form source ( path or html ) to the forms hash Validates that the id is unique + form_id + - a unique id to the form + form_hash + - a hash containing form path / html and tags
# unique id validation # adding to hash # handling tags
form_id
<not_specific>
form_hash
<not_specific>