Class: ChemistryParadise::Orbitals

Inherits:
Base
  • Object
show all
Defined in:
lib/chemistry_paradise/utility_scripts/orbitals.rb

Overview

ChemistryParadise::Orbitals

Constant Summary

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

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, #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

#initialize(upto_n = 10, run_already = true) ⇒ Orbitals

#

initialize

#


21
22
23
24
25
26
27
28
# File 'lib/chemistry_paradise/utility_scripts/orbitals.rb', line 21

def initialize(
    upto_n      = 10,
    run_already = true
  )
  reset
  set_upto(upto_n)
  run if run_already
end

Instance Method Details

#calculate_for_this_orbital(n) ⇒ Object

#

calculate_for_this_orbital

#


47
48
49
# File 'lib/chemistry_paradise/utility_scripts/orbitals.rb', line 47

def calculate_for_this_orbital(n)
  2 * (n ** 2)
end

#resetObject

#

reset

#


40
41
42
# File 'lib/chemistry_paradise/utility_scripts/orbitals.rb', line 40

def reset
  set_upto
end

#runObject

#

run

#


54
55
56
57
58
59
60
61
62
63
64
# File 'lib/chemistry_paradise/utility_scripts/orbitals.rb', line 54

def run
  e
  1.upto(@upto).each {|entry|
    e rev+
      '  '+entry.to_s.rjust(3)+''+
      sfancy(
        calculate_for_this_orbital(entry).to_s.rjust(3)
      )+' Orbitals.'
  }
  e
end

#set_upto(i = 10) ⇒ Object

#

set_upto

#


33
34
35
# File 'lib/chemistry_paradise/utility_scripts/orbitals.rb', line 33

def set_upto(i = 10) # 10 is default.
  @upto = i
end