Class: Reception::LibraryTypeHelper
- Inherits:
-
Object
- Object
- Reception::LibraryTypeHelper
- Defined in:
- app/models/reception/resource_factory.rb
Overview
A helper that deals with the creation of library type specific records.
Instance Method Summary collapse
- #create_library(request) ⇒ Object
- #create_request(sample, container, reception) ⇒ Object
-
#initialize(library_type, resource_factory, container_attributes) ⇒ LibraryTypeHelper
constructor
A new instance of LibraryTypeHelper.
Constructor Details
#initialize(library_type, resource_factory, container_attributes) ⇒ LibraryTypeHelper
Returns a new instance of LibraryTypeHelper.
237 238 239 240 241 |
# File 'app/models/reception/resource_factory.rb', line 237 def initialize(library_type, resource_factory, container_attributes) @library_type = library_type @resource_factory = resource_factory @container_attributes = container_attributes end |
Instance Method Details
#create_library(request) ⇒ Object
243 244 245 246 247 248 |
# File 'app/models/reception/resource_factory.rb', line 243 def create_library(request) # The library type is used to help build the correct library in the correct pipeline return unless @container_attributes[:library] @library_type.library_factory(request:, library_attributes: @container_attributes[:library]) end |
#create_request(sample, container, reception) ⇒ Object
250 251 252 253 254 255 256 257 258 259 |
# File 'app/models/reception/resource_factory.rb', line 250 def create_request(sample, container, reception) # The library type is used to help build the correct request in the correct pipeline @library_type.request_factory( sample:, container:, request_attributes: @container_attributes[:request], resource_factory: @resource_factory, reception: ) end |