Class: Faccts::RustCodeGenerator::RustNameToFunctionCallConverter
- Inherits:
-
Object
- Object
- Faccts::RustCodeGenerator::RustNameToFunctionCallConverter
- Defined in:
- lib/faccts/03_generating_code/rust_name_to_function_call_converter.rb
Defined Under Namespace
Classes: InvalidNameError, RustCharacterConverter
Instance Method Summary collapse
- #convert!(test_assertion) ⇒ Object
-
#initialize ⇒ RustNameToFunctionCallConverter
constructor
A new instance of RustNameToFunctionCallConverter.
Constructor Details
#initialize ⇒ RustNameToFunctionCallConverter
Returns a new instance of RustNameToFunctionCallConverter.
6 7 8 |
# File 'lib/faccts/03_generating_code/rust_name_to_function_call_converter.rb', line 6 def initialize @character_converter = RustCharacterConverter.new end |
Instance Method Details
#convert!(test_assertion) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/faccts/03_generating_code/rust_name_to_function_call_converter.rb', line 10 def convert!(test_assertion) @action_name = test_assertion.action_name @arguments = test_assertion.arguments || [] converted_name = converted_characters(stripped_action_name) raise InvalidNameError if all_characters_were_removed?(converted_name) "#{converted_name}(#{converted_arguments})" end |