module Iqvoc::Configuration::Core::ClassMethods

Public Instance Methods

ability_class() click to toggle source
# File lib/iqvoc/configuration/core.rb, line 170
def ability_class
  ability_class_name.constantize
end
all_languages() click to toggle source

returns a list of all languages selectable for labels and/or notes

# File lib/iqvoc/configuration/core.rb, line 183
def all_languages
  (Iqvoc::Concept.pref_labeling_languages +
      Iqvoc::Concept.further_labeling_class_names.values.flatten +
      note_languages).compact.map(&:to_s).uniq
end
change_note_class() click to toggle source
# File lib/iqvoc/configuration/core.rb, line 158
def change_note_class
  change_note_class_name.constantize
end
concept_modal_preview_enabled?() click to toggle source
# File lib/iqvoc/configuration/core.rb, line 195
def concept_modal_preview_enabled?
  config['concept_modal_preview'] == true
end
config(&block) click to toggle source

************** instance configuration **************

# File lib/iqvoc/configuration/core.rb, line 149
def config(&block)
  cfg = Iqvoc::Configuration::InstanceConfiguration.instance
  if block
    block.call(cfg)
  else
    return cfg
  end
end
engine?() click to toggle source
# File lib/iqvoc/configuration/core.rb, line 199
def engine?
  Iqvoc.const_defined?(:Engine)
end
first_level_classes() click to toggle source
# File lib/iqvoc/configuration/core.rb, line 166
def first_level_classes
  self.first_level_class_configuration_modules.map { |mod| mod.send(:base_class) }
end
host_version() click to toggle source
# File lib/iqvoc/configuration/core.rb, line 218
def host_version
  if Iqvoc.host_namespace
    Iqvoc.host_namespace::VERSION
  end
end
note_languages() click to toggle source
# File lib/iqvoc/configuration/core.rb, line 178
def note_languages
  config['languages.notes']
end
root() click to toggle source
# File lib/iqvoc/configuration/core.rb, line 203
def root
  if engine?
    Iqvoc::Engine.root
  else
    Rails.root
  end
end
routing_constraint() click to toggle source
# File lib/iqvoc/configuration/core.rb, line 211
def routing_constraint
  lambda do |params, req|
    langs = Iqvoc::Concept.pref_labeling_languages.join('|').presence || 'en'
    return params[:lang].to_s =~ /^#{langs}$/
  end
end
searchable_classes() click to toggle source
# File lib/iqvoc/configuration/core.rb, line 162
def searchable_classes
  searchable_class_names.keys.map(&:constantize)
end
title() click to toggle source
# File lib/iqvoc/configuration/core.rb, line 174
def title
  config['title']
end
title=(value) click to toggle source

@deprecated

# File lib/iqvoc/configuration/core.rb, line 190
def title=(value)
  ActiveSupport::Deprecation.warn 'title has been moved into instance configuration', caller
  self.config.register_setting('title', value)
end