Module: Utilities

Defined in:
lib/atome/extensions/utilities.rb

Overview

Utilities

Class Method Summary collapse

Class Method Details

.atomes(atome = nil) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/atome/extensions/utilities.rb', line 14

def self.atomes(atome = nil)
  # this method is used to hold all available type of atomes
  if atome
    instance_variable_get('@atomes').push(atome)
  else
    instance_variable_get('@atomes')
  end
end

.grab(params) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/atome/extensions/utilities.rb', line 32

def self.grab(params)
  atome_found = nil
  Universe.atomes.each do |atome|
    atome_found = atome if atome.id == params
  end
  atome_found
end

.history(params = nil) ⇒ Object



10
11
12
# File 'lib/atome/extensions/utilities.rb', line 10

def self.history(params = nil)
  instance_variable_get('@history')[Time.now] = params
end

.particles(particle = nil) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/atome/extensions/utilities.rb', line 23

def self.particles(particle = nil)
  # this method is used to hold all available type of particles
  if particle
    instance_variable_get('@particles').push(particle)
  else
    instance_variable_get('@particles')
  end
end