Class: ProductCatalogue::LibraryDriven
- Inherits:
-
Object
- Object
- ProductCatalogue::LibraryDriven
- Defined in:
- app/models/product_catalogue/library_driven.rb
Instance Attribute Summary collapse
-
#product ⇒ Object
readonly
Returns the value of attribute product.
Instance Method Summary collapse
-
#initialize(catalogue, submission_attributes) ⇒ LibraryDriven
constructor
A new instance of LibraryDriven.
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
#product ⇒ Object (readonly)
Returns the value of attribute product.
3 4 5 |
# File 'app/models/product_catalogue/library_driven.rb', line 3 def product @product end |