Method: Formup::Source#initialize

Defined in:
lib/formup/source.rb

#initialize(key, attribute_defs = {}, excludes = nil) ⇒ Source



10
11
12
13
14
15
16
# File 'lib/formup/source.rb', line 10

def initialize(key, attribute_defs = {}, excludes = nil)
  raise "Formup::Source require key param." if key.nil?

  @key = key.to_s
  @attribute_defs = attribute_defs.map { |k, v| Formup::AttrDef.new(k, v) } if attribute_defs
  @attribute_defs ||= []
end