Class: ChemistryParadise::Base
- Inherits:
-
Object
- Object
- ChemistryParadise::Base
- Defined in:
- lib/chemistry_paradise/base/base.rb,
lib/chemistry_paradise/base/colours.rb
Overview
ChemistryParadise::Base
Direct Known Subclasses
CalculateAtomicMass, CombustionAnalysis, ElectronNegativityChart, EqualizeChemicalFormula, EquationSolver, InteractiveChemistryShell, Orbitals, ParseCommandline, ShowElectronConfiguration, ShowElectronNegativityOfThisElement, ShowElement, ShowPeriodicTable, SplitMoleculeNames, Wetter
Constant Summary collapse
- NAMESPACE =
#
NAMESPACE
#
inspect
- FILE_MOLECULAR_FORMULA_OF_DIFFERENT_MOLECULES =
#
FILE_MOLECULAR_FORMULA_OF_DIFFERENT_MOLECULES
#
"#{PROJECT_BASE_DIRECTORY}yaml/molecular_formula_of_different_molecules.yml"
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
-
#be_quiet ⇒ Object
(also: #be_silent, #set_be_quiet)
# === be_quiet ========================================================================= #.
-
#be_verbose? ⇒ Boolean
(also: #be_verbose)
# === be_verbose? ========================================================================= #.
-
#cd(i) ⇒ Object
# === cd (cd tag) ========================================================================= #.
-
#cliner ⇒ Object
# === cliner.
-
#commandline_arguments? ⇒ Boolean
# === commandline_arguments? ========================================================================= #.
-
#do_use_the_english_language ⇒ Object
# === do_use_the_english_language ========================================================================= #.
-
#do_use_the_german_language ⇒ Object
# === do_use_the_german_language ========================================================================= #.
-
#do_we_use_english? ⇒ Boolean
# === do_we_use_english?.
-
#esystem(i, silence_output_from_system = false, &block) ⇒ Object
# === esystem (system tag) ========================================================================= #.
-
#first_argument? ⇒ Boolean
(also: #first?)
# === first_argument? ========================================================================= #.
-
#gold(i = '') ⇒ Object
# === gold ========================================================================= #.
-
#grey(i = '') ⇒ Object
# === grey ========================================================================= #.
-
#initialize_the_internal_hash ⇒ Object
# === initialize_the_internal_hash ========================================================================= #.
-
#internal_hash? ⇒ Boolean
(also: #internal_hash)
# === internal_hash? ========================================================================= #.
-
#is_on_roebe? ⇒ Boolean
# === is_on_roebe? ========================================================================= #.
-
#mediumpurple(i = '') ⇒ Object
# === mediumpurple ========================================================================= #.
-
#namespace? ⇒ Boolean
# === namespace? ========================================================================= #.
-
#olivedrab(i = '') ⇒ Object
# === olivedrab ========================================================================= #.
-
#opnn(i) ⇒ Object
# === opnn ========================================================================= #.
-
#reset ⇒ Object
# === reset (reset tag) ========================================================================= #.
-
#rev ⇒ Object
# === rev ========================================================================= #.
-
#royalblue(i = '') ⇒ Object
# === royalblue ========================================================================= #.
-
#set_be_verbose ⇒ Object
# === set_be_verbose ========================================================================= #.
-
#set_commandline_arguments(i = '') ⇒ Object
# === set_commandline_arguments ========================================================================= #.
-
#sfancy(i = '') ⇒ Object
# === sfancy ========================================================================= #.
-
#steelblue(i = '') ⇒ Object
# === steelblue ========================================================================= #.
-
#teal(i = '') ⇒ Object
# === teal ========================================================================= #.
-
#tomato(i = '') ⇒ Object
# === tomato ========================================================================= #.
-
#use_which_language? ⇒ Boolean
# === use_which_language? ========================================================================= #.
-
#yellow(i = '') ⇒ Object
# === yellow ========================================================================= #.
Methods included from Shared
#convert_parens, #is_number?, #periodic_table?, periodic_table?, #return_range_for_this_period, #square
Methods included from Constants
Instance Method Details
#be_quiet ⇒ Object Also known as: be_silent, set_be_quiet
#
be_quiet
#
203 204 205 |
# File 'lib/chemistry_paradise/base/base.rb', line 203 def be_quiet @be_verbose = false end |
#be_verbose? ⇒ Boolean Also known as: be_verbose
#
be_verbose?
#
211 212 213 |
# File 'lib/chemistry_paradise/base/base.rb', line 211 def be_verbose? @be_verbose end |
#cd(i) ⇒ Object
#
cd (cd tag)
#
140 141 142 |
# File 'lib/chemistry_paradise/base/base.rb', line 140 def cd(i) Dir.chdir(i) end |
#cliner ⇒ Object
#
cliner
This variant will return rather than output/display.
#
133 134 135 |
# File 'lib/chemistry_paradise/base/base.rb', line 133 def cliner '=' * 80 end |
#commandline_arguments? ⇒ Boolean
#
commandline_arguments?
#
103 104 105 |
# File 'lib/chemistry_paradise/base/base.rb', line 103 def commandline_arguments? @commandline_arguments end |
#do_use_the_english_language ⇒ Object
#
do_use_the_english_language
#
124 125 126 |
# File 'lib/chemistry_paradise/base/base.rb', line 124 def do_use_the_english_language ::ChemistryParadise.do_use_english end |
#do_use_the_german_language ⇒ Object
#
do_use_the_german_language
#
117 118 119 |
# File 'lib/chemistry_paradise/base/base.rb', line 117 def do_use_the_german_language ::ChemistryParadise.do_use_german end |
#do_we_use_english? ⇒ Boolean
#
do_we_use_english?
Query method to determine whether we will use english or whether we will use another language, for a project-wide setting.
#
88 89 90 |
# File 'lib/chemistry_paradise/base/base.rb', line 88 def do_we_use_english? (use_which_language? == :english) end |
#esystem(i, silence_output_from_system = false, &block) ⇒ Object
#
esystem (system tag)
#
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/chemistry_paradise/base/base.rb', line 147 def esystem( i, silence_output_from_system = false, &block ) yielded = nil if block_given? yielded = yield end case yielded # ======================================================================= # # === :be_quiet # ======================================================================= # when :be_quiet else # This is the default. puts i end case silence_output_from_system # ======================================================================= # # === :silence_output_from_system # ======================================================================= # when :silence_output_from_system silence_output_from_system = true end if silence_output_from_system # system i, out: File::NULL `#{i} 2>&1` else system i end end |
#first_argument? ⇒ Boolean Also known as: first?
#
first_argument?
#
110 111 112 |
# File 'lib/chemistry_paradise/base/base.rb', line 110 def first_argument? @commandline_arguments.first end |
#gold(i = '') ⇒ Object
#
gold
#
89 90 91 |
# File 'lib/chemistry_paradise/base/colours.rb', line 89 def gold(i = '') ::Colours.gold(i) end |
#grey(i = '') ⇒ Object
#
grey
#
33 34 35 |
# File 'lib/chemistry_paradise/base/colours.rb', line 33 def grey(i = '') "#{::Colours::GREY}#{i}#{Colours}#{rev}" end |
#initialize_the_internal_hash ⇒ Object
#
initialize_the_internal_hash
#
51 52 53 54 55 56 |
# File 'lib/chemistry_paradise/base/base.rb', line 51 def initialize_the_internal_hash # ======================================================================= # # === @internal_hash # ======================================================================= # @internal_hash = {} end |
#internal_hash? ⇒ Boolean Also known as: internal_hash
#
internal_hash?
#
61 62 63 |
# File 'lib/chemistry_paradise/base/base.rb', line 61 def internal_hash? @internal_hash end |
#is_on_roebe? ⇒ Boolean
#
is_on_roebe?
#
182 183 184 |
# File 'lib/chemistry_paradise/base/base.rb', line 182 def is_on_roebe? ChemistryParadise.is_on_roebe? end |
#mediumpurple(i = '') ⇒ Object
#
mediumpurple
#
75 76 77 |
# File 'lib/chemistry_paradise/base/colours.rb', line 75 def mediumpurple(i = '') ::Colours.mediumpurple(i) end |
#namespace? ⇒ Boolean
#
namespace?
#
189 190 191 |
# File 'lib/chemistry_paradise/base/base.rb', line 189 def namespace? @namespace end |
#olivedrab(i = '') ⇒ Object
#
olivedrab
#
82 83 84 |
# File 'lib/chemistry_paradise/base/colours.rb', line 82 def olivedrab(i = '') ::Colours.olivedrab(i) end |
#opnn(i) ⇒ Object
#
opnn
#
68 69 70 71 72 73 |
# File 'lib/chemistry_paradise/base/base.rb', line 68 def opnn(i) if i.is_a? String i = { namespace: i } end Opn.opn(i) # Delegate to module Opn here. end |
#reset ⇒ Object
#
reset (reset tag)
#
41 42 43 44 45 46 |
# File 'lib/chemistry_paradise/base/base.rb', line 41 def reset # ======================================================================= # # === @be_verbose # ======================================================================= # @be_verbose = true end |
#rev ⇒ Object
#
rev
#
19 20 21 |
# File 'lib/chemistry_paradise/base/colours.rb', line 19 def rev ::Colours.rev end |
#royalblue(i = '') ⇒ Object
#
royalblue
#
68 69 70 |
# File 'lib/chemistry_paradise/base/colours.rb', line 68 def royalblue(i = '') ::Colours.royalblue(i) end |
#set_be_verbose ⇒ Object
#
set_be_verbose
#
196 197 198 |
# File 'lib/chemistry_paradise/base/base.rb', line 196 def set_be_verbose @be_verbose = true end |
#set_commandline_arguments(i = '') ⇒ Object
#
set_commandline_arguments
#
95 96 97 98 |
# File 'lib/chemistry_paradise/base/base.rb', line 95 def set_commandline_arguments(i = '') i = [i].flatten.compact @commandline_arguments = i end |
#sfancy(i = '') ⇒ Object
#
sfancy
#
26 27 28 |
# File 'lib/chemistry_paradise/base/colours.rb', line 26 def sfancy(i = '') ::Colours.sfancy(i) end |
#steelblue(i = '') ⇒ Object
#
steelblue
#
40 41 42 |
# File 'lib/chemistry_paradise/base/colours.rb', line 40 def steelblue(i = '') ::Colours.steelblue(i) end |
#teal(i = '') ⇒ Object
#
teal
#
54 55 56 |
# File 'lib/chemistry_paradise/base/colours.rb', line 54 def teal(i = '') ::Colours.teal(i) end |
#tomato(i = '') ⇒ Object
#
tomato
#
61 62 63 |
# File 'lib/chemistry_paradise/base/colours.rb', line 61 def tomato(i = '') ::Colours.tomato(i) end |
#use_which_language? ⇒ Boolean
#
use_which_language?
#
78 79 80 |
# File 'lib/chemistry_paradise/base/base.rb', line 78 def use_which_language? ::ChemistryParadise.use_which_language? end |
#yellow(i = '') ⇒ Object
#
yellow
#
47 48 49 |
# File 'lib/chemistry_paradise/base/colours.rb', line 47 def yellow(i = '') ::Colours.yellow(i) end |