Module: OldTypedParams::ClassMethods

Defined in:
lib/typed_params.rb

Instance Method Summary collapse

Instance Method Details

#typed_params(method, scheme) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/typed_params.rb', line 20

def typed_params(method, scheme)
  unless class_variables.include?(:@@typed_fields)
    class_variable_set(:@@typed_fields, {})
  end
  controller_class_name = to_s.underscore.to_sym
  typed_fields = class_variable_get(:@@typed_fields)
  class_variable_set(:@@typed_fields, typed_fields.merge("#{controller_class_name}_#{method}".to_sym => scheme))
end