Class: FormObject::Store

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/form_object/store.rb

Instance Method Summary collapse

Instance Method Details

#find(critery = {}) ⇒ Object



17
18
19
# File 'lib/form_object/store.rb', line 17

def find(critery = {})
  storage.select{|mapping_info| mapping_info.match?(critery)}
end

#map_for_model(form, model, options = {}) ⇒ Object



11
12
13
14
15
# File 'lib/form_object/store.rb', line 11

def map_for_model( form, model, options = {})
  form_name = retrive_form_name(form, options.delete(:as))
  storage << FormObject::Base::MappingInformation.new(form, model, form_name, options )
  include_integration( model )
end

#storageObject



7
8
9
# File 'lib/form_object/store.rb', line 7

def storage
  @storage ||= Set.new
end