Class: Servactory::Inputs::Tools::Unnecessary
- Inherits:
-
Object
- Object
- Servactory::Inputs::Tools::Unnecessary
- Defined in:
- lib/servactory/inputs/tools/unnecessary.rb
Class Method Summary collapse
Instance Method Summary collapse
- #find! ⇒ Object
-
#initialize(context, collection_of_inputs) ⇒ Unnecessary
constructor
A new instance of Unnecessary.
Constructor Details
#initialize(context, collection_of_inputs) ⇒ Unnecessary
Returns a new instance of Unnecessary.
11 12 13 14 |
# File 'lib/servactory/inputs/tools/unnecessary.rb', line 11 def initialize(context, collection_of_inputs) @context = context @collection_of_inputs = collection_of_inputs end |
Class Method Details
.find! ⇒ Object
7 8 9 |
# File 'lib/servactory/inputs/tools/unnecessary.rb', line 7 def self.find!(...) new(...).find! end |
Instance Method Details
#find! ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/servactory/inputs/tools/unnecessary.rb', line 16 def find! return if unnecessary_attributes.empty? = @context.send(:servactory_service_info).translate( "inputs.tools.find_unnecessary.error", unnecessary_attributes: unnecessary_attributes.join(", ") ) @context.fail_input!(nil, message: ) end |