Sha256: 0e058e9ab305c53eb1379f173fe0987d7ee03b1f6dd20deb1b09ad5d45229f86
Contents?: true
Size: 681 Bytes
Versions: 1
Compression:
Stored size: 681 Bytes
Contents
module HungryForm class Configuration def initialize init_element_default_attributes end private def init_element_default_attributes @elements_default_attributes = {} HungryForm::Elements.all_classes.each do |klass| klass_name = klass.to_s.underscore.to_sym @elements_default_attributes[klass_name] = {} # Assign a default attribute to an element define_singleton_method klass_name do |attributes = {}| if attributes.any? @elements_default_attributes[klass_name].merge!(attributes) end @elements_default_attributes[klass_name] end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
hungryform-0.0.11 | lib/hungryform/configuration.rb |