Class: MaterialCodeGenerator
- Inherits:
-
Object
- Object
- MaterialCodeGenerator
- Defined in:
- app/business/material_code_generator.rb
Instance Attribute Summary collapse
-
#material_object ⇒ Object
Returns the value of attribute material_object.
-
#material_repository ⇒ Object
Returns the value of attribute material_repository.
Instance Method Summary collapse
- #generate! ⇒ Object
-
#initialize(material_object, material_repository = Material) ⇒ MaterialCodeGenerator
constructor
A new instance of MaterialCodeGenerator.
Constructor Details
#initialize(material_object, material_repository = Material) ⇒ MaterialCodeGenerator
Returns a new instance of MaterialCodeGenerator.
6 7 8 9 |
# File 'app/business/material_code_generator.rb', line 6 def initialize(material_object, material_repository = Material) self.material_object = material_object self.material_repository = material_repository end |
Instance Attribute Details
#material_object ⇒ Object
Returns the value of attribute material_object.
2 3 4 |
# File 'app/business/material_code_generator.rb', line 2 def material_object @material_object end |
#material_repository ⇒ Object
Returns the value of attribute material_repository.
2 3 4 |
# File 'app/business/material_code_generator.rb', line 2 def material_repository @material_repository end |
Instance Method Details
#generate! ⇒ Object
11 12 13 14 15 |
# File 'app/business/material_code_generator.rb', line 11 def generate! return unless materials_code_can_changed? material_object.code = material_code end |