Sha256: b2ec6847cff7105681c55cf758deaef7313f6ab46e35b1b13c05b875e7e8125f

Contents?: true

Size: 668 Bytes

Versions: 20

Compression:

Stored size: 668 Bytes

Contents

class ApplicationDictionary < ::ApplicationController
  include VisualConditionBuilder::ApplicationHelper

  def initialize(request)
    self.request = request
  end

  def dictionary(dictionar_klass_name, context)
    @klass = Object.const_get "#{dictionar_klass_name}".classify
    dictionary = @klass.dictionary(context)
    dictionary.each do |field|
      if field[:values].present? && field[:values].is_a?(Proc)
        field[:values] = self.instance_exec(&field[:values])
      end
      if field[:operators].present? && field[:operators].is_a?(Proc)
        field[:operators] = self.instance_exec(&field[:operators])
      end
    end
    dictionary
  end

end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
visual_condition_builder-2.2.7 app/controllers/application_dictionary.rb
visual_condition_builder-2.2.6 app/controllers/application_dictionary.rb
visual_condition_builder-2.2.5 app/controllers/application_dictionary.rb
visual_condition_builder-2.2.4 app/controllers/application_dictionary.rb
visual_condition_builder-2.2.3 app/controllers/application_dictionary.rb
visual_condition_builder-2.2.2 app/controllers/application_dictionary.rb
visual_condition_builder-2.2.1 app/controllers/application_dictionary.rb
visual_condition_builder-2.2.0 app/controllers/application_dictionary.rb
visual_condition_builder-2.1.6 app/controllers/application_dictionary.rb
visual_condition_builder-2.1.5 app/controllers/application_dictionary.rb
visual_condition_builder-2.1.4 app/controllers/application_dictionary.rb
visual_condition_builder-2.1.3 app/controllers/application_dictionary.rb
visual_condition_builder-2.1.2 app/controllers/application_dictionary.rb
visual_condition_builder-2.1.1 app/controllers/application_dictionary.rb
visual_condition_builder-2.1.0 app/controllers/application_dictionary.rb
visual_condition_builder-2.0.0 app/controllers/application_dictionary.rb
visual_condition_builder-0.1.6 app/controllers/application_dictionary.rb
visual_condition_builder-0.1.5 app/controllers/application_dictionary.rb
visual_condition_builder-0.1.4 app/controllers/application_dictionary.rb
visual_condition_builder-0.1.3 app/controllers/application_dictionary.rb