Class: ChemistryParadise::ElectronNegativityChart

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

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

Class Method Summary collapse

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

#electron_negativity_chart?

Constructor Details

#initialize(optional_input = nil, run_already = true) ⇒ ElectronNegativityChart

#

initialize

#


19
20
21
22
23
24
25
# File 'lib/chemistry_paradise/utility_scripts/electron_negativity_chart.rb', line 19

def initialize(
    optional_input = nil,
    run_already    = true
  )
  set_input(optional_input)
  run if run_already
end

Class Method Details

.showObject

#

ElectronNegativityChart.show_chart

#


58
59
60
# File 'lib/chemistry_paradise/utility_scripts/electron_negativity_chart.rb', line 58

def self.show
  ElectronNegativityChart.new.show_chart
end

Instance Method Details

#entry?Boolean

#

entry?

#

Returns:

  • (Boolean)


51
52
53
# File 'lib/chemistry_paradise/utility_scripts/electron_negativity_chart.rb', line 51

def entry?
  @input.first
end

#runObject

#

run

#


65
66
67
68
69
70
71
# File 'lib/chemistry_paradise/utility_scripts/electron_negativity_chart.rb', line 65

def run
  if @input.nil?
    show_chart
  else
    e electron_negativity_chart?[entry?]
  end
end

#set_input(i) ⇒ Object

#

set_input

#


30
31
32
# File 'lib/chemistry_paradise/utility_scripts/electron_negativity_chart.rb', line 30

def set_input(i)
  @input = i
end

#show_chartObject

#

show_chart

Show the particular electronegativy chart for that element.

#


39
40
41
42
43
44
45
46
# File 'lib/chemistry_paradise/utility_scripts/electron_negativity_chart.rb', line 39

def show_chart
  # ======================================================================= #
  # Tap into the elctron negativity chart next.
  # ======================================================================= #
  electron_negativity_chart?.each_pair {|key, value|
    e "#{key.ljust(2)} -> #{value.to_s}"
  }
end