Class: ProductCatalogue::LibraryDriven

Inherits:
Object
  • Object
show all
Defined in:
app/models/product_catalogue/library_driven.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(catalogue, submission_attributes) ⇒ LibraryDriven

Returns a new instance of LibraryDriven.



5
6
7
8
9
10
11
# File 'app/models/product_catalogue/library_driven.rb', line 5

def initialize(catalogue, submission_attributes)
  # library_type_name will be set to nil if it was not defined
  # We can't use fetch here, as in some cases submission_attributes[:request_options] is nil
  # rather than just undefined.
  library_type_name = (submission_attributes[:request_options] || {})[:library_type]
  @product = catalogue.product_with_default(library_type_name)
end

Instance Attribute Details

#productObject (readonly)

Returns the value of attribute product.



3
4
5
# File 'app/models/product_catalogue/library_driven.rb', line 3

def product
  @product
end