Kiss A simpler, smarter web application framework for Ruby

Kiss::Form::AttributesSetter Module

Methods

In Files

Public Instance Methods

set_attributes(attrs_original,required = []) source

Not documented

    # File lib/kiss/form.rb, line 6
      def set_attributes(attrs_original,required = [])
        unless attrs_original.is_a?(Hash) then
          raise "first parameter must be a hash of attributes: #{attrs_original}"
        end
    
        attrs = attrs_original.clone
    
        required.each do |key|
          raise "missing required parameter '#{key}'" unless attrs[key]
          send("#{key}=", attrs[key])
          attrs.delete(key)
        end
    
        attrs.each_pair do |key,value|
          send("#{key}=", value)
        end
      end
    

Disabled; run with $DEBUG to generate this.