Class: ReactorSDK::Resources::LibrarySnapshotExtensionIndex

Inherits:
Object
  • Object
show all
Defined in:
lib/reactor_sdk/resources/library_snapshot_extension_index.rb

Instance Method Summary collapse

Constructor Details

#initialize(data_elements:, rule_components_by_rule_id:, find_resource:, sort_rule_components:) ⇒ LibrarySnapshotExtensionIndex

Returns a new instance of LibrarySnapshotExtensionIndex.



6
7
8
9
10
11
12
13
14
# File 'lib/reactor_sdk/resources/library_snapshot_extension_index.rb', line 6

def initialize(data_elements:, rule_components_by_rule_id:, find_resource:, sort_rule_components:)
  @data_elements = Array(data_elements)
  @rule_components_by_rule_id = rule_components_by_rule_id
  @find_resource = find_resource
  @sort_rule_components = sort_rule_components
  @data_elements_by_extension = build_data_elements_index
  @rule_components_by_extension = build_rule_components_index
  @rules_by_extension = build_rules_index
end

Instance Method Details

#data_elements_for(extension_id) ⇒ Object



16
17
18
# File 'lib/reactor_sdk/resources/library_snapshot_extension_index.rb', line 16

def data_elements_for(extension_id)
  @data_elements_by_extension.fetch(extension_id, [])
end

#rule_components_for(extension_id) ⇒ Object



20
21
22
# File 'lib/reactor_sdk/resources/library_snapshot_extension_index.rb', line 20

def rule_components_for(extension_id)
  @rule_components_by_extension.fetch(extension_id, [])
end

#rules_for(extension_id) ⇒ Object



24
25
26
# File 'lib/reactor_sdk/resources/library_snapshot_extension_index.rb', line 24

def rules_for(extension_id)
  @rules_by_extension.fetch(extension_id, [])
end