Class: Udongo::Configs::Forms

Inherits:
Object
  • Object
show all
Defined in:
lib/udongo/configs/forms.rb

Instance Method Summary collapse

Constructor Details

#initializeForms

Returns a new instance of Forms.



4
5
6
# File 'lib/udongo/configs/forms.rb', line 4

def initialize
  @configs = {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/udongo/configs/forms.rb', line 8

def method_missing(method, *args, &block)
  unless @configs[method]
    super unless ::Form.find_by(identifier: method)
    @configs[method] = OpenStruct.new(datagrid_fields: [], filter_fields: [])
  end

  @configs[method]
end