Class: ReactorSDK::LibrarySnapshotBuilder
- Inherits:
-
Object
- Object
- ReactorSDK::LibrarySnapshotBuilder
- Defined in:
- lib/reactor_sdk/library_snapshot_builder.rb
Instance Method Summary collapse
- #build(library_id, property_id:) ⇒ Object
-
#initialize(library_loader:, revisions_endpoint:, rule_components_endpoint:) ⇒ LibrarySnapshotBuilder
constructor
A new instance of LibrarySnapshotBuilder.
Constructor Details
#initialize(library_loader:, revisions_endpoint:, rule_components_endpoint:) ⇒ LibrarySnapshotBuilder
Returns a new instance of LibrarySnapshotBuilder.
5 6 7 8 9 |
# File 'lib/reactor_sdk/library_snapshot_builder.rb', line 5 def initialize(library_loader:, revisions_endpoint:, rule_components_endpoint:) @library_loader = library_loader @revisions_endpoint = revisions_endpoint @rule_components_endpoint = rule_components_endpoint end |
Instance Method Details
#build(library_id, property_id:) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/reactor_sdk/library_snapshot_builder.rb', line 11 def build(library_id, property_id:) library = @library_loader.call(library_id) Resources::LibrarySnapshot.new( property_id: property_id, library: library, rule_components_by_rule_id: build_rule_components_index(library) ) end |