Method: ToQuickform::Rule#initialize

Defined in:
lib/to_quickform/rule.rb

#initialize(attributes = {}) ⇒ Rule

Returns a new instance of Rule.



9
10
11
12
13
14
15
16
17
# File 'lib/to_quickform/rule.rb', line 9

def initialize(attributes = {})
  if attributes.is_a?(Hash)
    (required_attributes + optional_attributes).each do |key|
      value = attributes[key]
      self.send "#{key}=", value
    end
  end
  attr_missing!
end