Class: ChemistryParadise::ShowElectronNegativityOfThisElement
- Inherits:
-
Base
- Object
- Base
- ChemistryParadise::ShowElectronNegativityOfThisElement
show all
- Defined in:
- lib/chemistry_paradise/utility_scripts/show_electron_negativity_of_this_element.rb
Overview
ChemistryParadise::ShowElectronNegativityOfThisElement
Constant Summary
collapse
- NAMESPACE =
inspect
Constants inherited
from Base
Base::FILE_MOLECULAR_FORMULA_OF_DIFFERENT_MOLECULES
Constants included
from Shared
ChemistryParadise::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
Class Method Summary
collapse
-
.[](i = '') ⇒ Object
# === [] ========================================================================= #.
Instance Method Summary
collapse
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, #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
#electron_negativity_chart?
Constructor Details
31
32
33
34
35
36
37
38
|
# File 'lib/chemistry_paradise/utility_scripts/show_electron_negativity_of_this_element.rb', line 31
def initialize(
i = nil,
run_already = true
)
reset
set_input(i)
run if run_already
end
|
Class Method Details
.[](i = '') ⇒ Object
95
96
97
|
# File 'lib/chemistry_paradise/utility_scripts/show_electron_negativity_of_this_element.rb', line 95
def self.[](i = '')
self.new(i)
end
|
Instance Method Details
59
60
61
|
# File 'lib/chemistry_paradise/utility_scripts/show_electron_negativity_of_this_element.rb', line 59
def input?
@input
end
|
#opnn ⇒ Object
88
89
90
|
# File 'lib/chemistry_paradise/utility_scripts/show_electron_negativity_of_this_element.rb', line 88
def opnn
super(NAMESPACE)
end
|
#reset ⇒ Object
43
44
45
46
|
# File 'lib/chemistry_paradise/utility_scripts/show_electron_negativity_of_this_element.rb', line 43
def reset
super()
@dataset = Constants::ELECTRON_NEGATIVITY_CHART
end
|
#run ⇒ Object
66
67
68
|
# File 'lib/chemistry_paradise/utility_scripts/show_electron_negativity_of_this_element.rb', line 66
def run
try_to_detect_the_electron_negativity_of_the_passed_elements
end
|
51
52
53
54
|
# File 'lib/chemistry_paradise/utility_scripts/show_electron_negativity_of_this_element.rb', line 51
def set_input(i = '')
i = [i] unless i.is_a? Array
@input = i
end
|
#try_to_detect_the_electron_negativity_of_the_passed_elements ⇒ Object
#
try_to_detect_the_electron_negativity_of_the_passed_elements
#
73
74
75
76
77
78
79
80
81
82
83
|
# File 'lib/chemistry_paradise/utility_scripts/show_electron_negativity_of_this_element.rb', line 73
def try_to_detect_the_electron_negativity_of_the_passed_elements
dataset = @dataset
input?.each {|this_element|
if dataset.has_key? this_element
electron_negativity_value = dataset[this_element]
e "#{simp(this_element.ljust(2))} has an electron negativity of "\
"#{sfancy(electron_negativity_value)}"\
" (in this Pauling electronegativity scale)"
end
}
end
|