Class: ChemistryParadise::EqualizeChemicalFormula
- Defined in:
- lib/chemistry_paradise/utility_scripts/equalize_chemical_formula.rb
Overview
EqualizeChemicalFormula
Constant Summary collapse
- DEFAULT_FORMULA =
#
DEFAULT_FORMULA
#
'Fe(OH)3 + H2SO4 -> Fe2(SO4)3 + H2O'
Constants inherited from Base
Base::FILE_MOLECULAR_FORMULA_OF_DIFFERENT_MOLECULES, Base::NAMESPACE
Constants included from Shared
Shared::ARRAY_TEST_THESE_MOLECULES
Constants included from Constants
Constants::ELECTRON_NEGATIVITY_CHART, Constants::FILE_ATOMGEWICHTE, Constants::FILE_ELECTRON_NEGATIVITY_CHART, Constants::FILE_PERIODIC_TABLE_OF_THE_ELEMENTS, Constants::N, Constants::PLANK_CONSTANT, Constants::PROPER_FILLORDER, Constants::SPEED_OF_LIGHT
Instance Method Summary collapse
-
#analyze_dataset ⇒ Object
# === analyze_dataset ========================================================================= #.
-
#initialize(i = nil, run_already = true) ⇒ EqualizeChemicalFormula
constructor
# === initialize ========================================================================= #.
-
#run ⇒ Object
# === run (run tag) ========================================================================= #.
-
#set_original_input(i) ⇒ Object
# === set_original_input ========================================================================= #.
-
#set_test_this_formula(i = DEFAULT_FORMULA) ⇒ Object
# === set_test_this_formula ========================================================================= #.
Methods inherited from Base
#be_quiet, #be_verbose?, #cd, #cliner, #commandline_arguments?, #do_use_the_english_language, #do_use_the_german_language, #do_we_use_english?, #esystem, #first_argument?, #gold, #grey, #initialize_the_internal_hash, #internal_hash?, #is_on_roebe?, #mediumpurple, #namespace?, #olivedrab, #opnn, #reset, #rev, #royalblue, #set_be_verbose, #set_commandline_arguments, #sfancy, #steelblue, #teal, #tomato, #use_which_language?, #yellow
Methods included from Shared
#convert_parens, #is_number?, #periodic_table?, periodic_table?, #return_range_for_this_period, #square
Methods included from Constants
Constructor Details
#initialize(i = nil, run_already = true) ⇒ EqualizeChemicalFormula
#
initialize
#
30 31 32 33 34 35 36 |
# File 'lib/chemistry_paradise/utility_scripts/equalize_chemical_formula.rb', line 30 def initialize( i = nil, run_already = true ) set_test_this_formula(i) run if run_already end |
Instance Method Details
#analyze_dataset ⇒ Object
#
analyze_dataset
#
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/chemistry_paradise/utility_scripts/equalize_chemical_formula.rb', line 61 def analyze_dataset splitted = @test_this_formula.split('->') links = splitted[0] rechts = splitted[1] opn; e 'Auf der '+RED+'linken Seite '+WHITE+'finden wir: '+links opn; e 'Auf der '+RED+'rechten Seite '+WHITE+'finden wir: '+rechts pp 'TODO: WIR MÜSSEN NOCH BERECHNEN WIE VIELE' pp 'ELEMENTE DORT VORKOMMEN' pp splitted end |
#run ⇒ Object
#
run (run tag)
#
75 76 77 78 |
# File 'lib/chemistry_paradise/utility_scripts/equalize_chemical_formula.rb', line 75 def run analyze_dataset pp self end |
#set_original_input(i) ⇒ Object
#
set_original_input
#
41 42 43 |
# File 'lib/chemistry_paradise/utility_scripts/equalize_chemical_formula.rb', line 41 def set_original_input(i) @original_input = i end |
#set_test_this_formula(i = DEFAULT_FORMULA) ⇒ Object
#
set_test_this_formula
#
48 49 50 51 52 53 54 55 56 |
# File 'lib/chemistry_paradise/utility_scripts/equalize_chemical_formula.rb', line 48 def set_test_this_formula( i = DEFAULT_FORMULA ) i = DEFAULT_FORMULA if i.nil? i = DEFAULT_FORMULA if i.empty? set_original_input(i) # Call this before parse(). i = parse(i) @test_this_formula = i end |