Class: Labimotion::VocabularyHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/labimotion/libs/vocabulary_handler.rb

Class Method Summary collapse

Class Method Details

.load_all_vocabulariesObject



18
19
20
# File 'lib/labimotion/libs/vocabulary_handler.rb', line 18

def load_all_vocabularies
  load_from_files + load_from_database
end

.load_app_vocabulariesObject



22
23
24
# File 'lib/labimotion/libs/vocabulary_handler.rb', line 22

def load_app_vocabularies
  load_from_files
end

.update_vocabularies(properties, current_user, element) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/labimotion/libs/vocabulary_handler.rb', line 6

def update_vocabularies(properties, current_user, element)
  return properties if properties.nil? || !properties.is_a?(Hash) || properties[Labimotion::Prop::LAYERS].nil?

  properties[Labimotion::Prop::LAYERS].each do |key, layer|
    update_layer_vocabularies!(layer, key, properties, current_user, element)
  end
  properties
rescue StandardError => e
  Labimotion.log_exception(e, current_user)
  properties
end