Class: Chemistry::Element::Atom
- Inherits:
-
Object
- Object
- Chemistry::Element::Atom
- Defined in:
- lib/chemistry/element/atom.rb
Class Method Summary collapse
- .atomic_number(atomic_number) ⇒ Object
- .atomic_weight(atomic_weight) ⇒ Object
- .melting_point(melting_point) ⇒ Object
- .symbol(symbol) ⇒ Object
Instance Method Summary collapse
Class Method Details
.atomic_number(atomic_number) ⇒ Object
11 12 13 |
# File 'lib/chemistry/element/atom.rb', line 11 def atomic_number atomic_number const_set :ATOMIC_NUMBER, atomic_number end |
.atomic_weight(atomic_weight) ⇒ Object
15 16 17 |
# File 'lib/chemistry/element/atom.rb', line 15 def atomic_weight atomic_weight const_set :ATOMIC_WEIGHT, atomic_weight end |
.melting_point(melting_point) ⇒ Object
19 20 21 |
# File 'lib/chemistry/element/atom.rb', line 19 def melting_point melting_point const_set :MELTING_POINT, Chemistry::Temperature.parse(melting_point) end |
.symbol(symbol) ⇒ Object
7 8 9 |
# File 'lib/chemistry/element/atom.rb', line 7 def symbol symbol const_set :SYMBOL, symbol end |
Instance Method Details
#atomic_number ⇒ Object
28 29 30 |
# File 'lib/chemistry/element/atom.rb', line 28 def atomic_number self.class::ATOMIC_NUMBER end |
#atomic_weight ⇒ Object
32 33 34 |
# File 'lib/chemistry/element/atom.rb', line 32 def atomic_weight self.class::ATOMIC_WEIGHT end |
#melting_point ⇒ Object
36 37 38 |
# File 'lib/chemistry/element/atom.rb', line 36 def melting_point self.class::MELTING_POINT end |
#symbol ⇒ Object
24 25 26 |
# File 'lib/chemistry/element/atom.rb', line 24 def symbol self.class::SYMBOL end |