Method: TecDoc::AssemblyGroup.all
- Defined in:
- lib/tec_doc/assembly_group.rb
.all(options = {}) ⇒ Array<TecDoc::AssemblyGroup>
Find vehicle, axle, motor or universal assembly groups for the search tree
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/tec_doc/assembly_group.rb', line 25 def self.all( = {}) = { :lang => I18n.locale.to_s }.merge() if [:linking_target_id] [:country] ||= TecDoc.client.country response = TecDoc.client.request(:get_linked_child_nodes_all_linking_target, ) else response = TecDoc.client.request(:get_child_nodes_all_linking_target2, ) end groups = response.map do |attributes| attributes[:scope] = new(attributes) end if [:child_nodes] group_ids_map = {} groups.each do |group| group_ids_map[group.id] = group end groups.each do |group| parent = group_ids_map[group.parent_id] if parent parent.add_child(group) end end end groups end |