Class: Hiptest::ActionwordUidIndexer

Inherits:
Object
  • Object
show all
Defined in:
lib/hiptest-publisher/indexers/actionword_uid_indexer.rb

Instance Method Summary collapse

Constructor Details

#initialize(project) ⇒ ActionwordUidIndexer



3
4
5
6
7
# File 'lib/hiptest-publisher/indexers/actionword_uid_indexer.rb', line 3

def initialize(project)
  @project = project
  @indexed = {}
  index_actionwords
end

Instance Method Details

#get_index(uid) ⇒ Object



21
22
23
# File 'lib/hiptest-publisher/indexers/actionword_uid_indexer.rb', line 21

def get_index(uid)
  @indexed[uid]
end

#index_actionwordsObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/hiptest-publisher/indexers/actionword_uid_indexer.rb', line 9

def index_actionwords
  @project.children[:actionwords].children[:actionwords].each do |actionword|
    index_actionword(actionword)
  end

  @project.children[:libraries].children[:libraries].each do |library|
    library.children[:actionwords].each do |actionword|
      index_actionword(actionword, library: library)
    end
  end
end