class ChemistryParadise::ParseCommandline
Public Class Methods
Public Instance Methods
berechne_atomgewicht(i)
click to toggle source
#¶ ↑
berechne_atomgewicht
¶ ↑
#¶ ↑
# File lib/chemistry_paradise/commandline/parse_commandline.rb, line 68 def berechne_atomgewicht(i) pp i if i.is_a? Array i.flatten.each {|entry| berechne_atomgewicht(i) } else if i == :test_default_molecules i = ARRAY_TEST_THESE_MOLECULES end if i.is_a? Array berechne_atomgewicht(i) else e sprintf( 'The mass number of %-4s is %3s', i, ChemistryParadise::CalculateAtomicMass.new(i).result.to_s ) end end end
reset()
click to toggle source
run()
click to toggle source
set_commandline(i)
click to toggle source
show_help()
click to toggle source
#¶ ↑
show_help
¶ ↑
The help options can be queried via:
chemistry_paradise --help
#¶ ↑
# File lib/chemistry_paradise/commandline/help.rb, line 17 def show_help e 'The following options are documented:' e e ' --molmassen? # show '\ 'where the molmasses are kept (a file)' e ' --electronegativity-of=F/Fe # report '\ 'the electronegativitiy of the elements F '\ 'and Fe (Fluor and Iron)' e ' --show_electron_negativity_chart # show '\ 'the electron negativity chart of the atoms' e ' /Quecksilber/ # use '\ 'a pseudo-regex to obtain the element-symbol '\ 'from a german name' e ' ^^^ the above // is called a pseudo-regex; pseudo '\ 'because it is actually a String and not a regex' e end
show_the_periodic_table()
click to toggle source
#¶ ↑
show_the_periodic_table
¶ ↑
#¶ ↑
# File lib/chemistry_paradise/commandline/parse_commandline.rb, line 41 def show_the_periodic_table _ = ::ChemistryParadise.periodic_table? if File.exist? _ YAML.load_file(_).each_pair {|key, value| e ' '+(key.to_s+ ':').ljust(3)+' '+value.to_s.rjust(2) } end end