class ChemistryParadise::ElectronNegativityChart

Public Class Methods

new( optional_input = nil, run_already = true ) click to toggle source
#

initialize

#
# File lib/chemistry_paradise/electron_negativity_chart.rb, line 19
def initialize(
    optional_input = nil,
    run_already    = true
  )
  set_input(optional_input)
  run if run_already
end
show() click to toggle source
#

ElectronNegativityChart.show_chart

#
# File lib/chemistry_paradise/electron_negativity_chart.rb, line 58
def self.show
  ElectronNegativityChart.new.show_chart
end

Public Instance Methods

entry?() click to toggle source
#

entry?

#
# File lib/chemistry_paradise/electron_negativity_chart.rb, line 51
def entry?
  @input.first
end
run() click to toggle source
#

run

#
# File lib/chemistry_paradise/electron_negativity_chart.rb, line 65
def run
  if @input.nil?
    show_chart
  else
    e electron_negativity_chart?[entry?]
  end
end
set_input(i) click to toggle source
#

set_input

#
# File lib/chemistry_paradise/electron_negativity_chart.rb, line 30
def set_input(i)
  @input = i
end
show_chart() click to toggle source
#

show_chart

Show the particular electronegativy chart for that element.

#
# File lib/chemistry_paradise/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