Class: NERA::Simulator

Inherits:
Object
  • Object
show all
Defined in:
lib/nera/nera_simulator.rb

Constant Summary collapse

Parameters =
[]
@@inherited =

class methods, variables

[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSimulator

Returns a new instance of Simulator.



11
12
13
14
# File 'lib/nera/nera_simulator.rb', line 11

def initialize
  @param = {}
  self.class::Parameters.each do |pa| @param[ pa[0] ] = pa[2] end
end

Instance Attribute Details

#paramObject

Returns the value of attribute param.



9
10
11
# File 'lib/nera/nera_simulator.rb', line 9

def param
  @param
end

Class Method Details

.add_simulator(sim_class) ⇒ Object

Raises:

  • (ArgumentError)


33
34
35
36
37
# File 'lib/nera/nera_simulator.rb', line 33

def self.add_simulator( sim_class)
  raise ArgumentError unless sim_class.is_a?(Class)
  @@inherited << sim_class
  @@inherited.uniq!
end

.inherited(subclass) ⇒ Object



19
20
21
# File 'lib/nera/nera_simulator.rb', line 19

def self.inherited(subclass)
  @@inherited << subclass
end

.inherited_simulatorsObject



24
25
26
# File 'lib/nera/nera_simulator.rb', line 24

def self.inherited_simulators
  return @@inherited
end

.remove_simulator(sim_class) ⇒ Object

Raises:

  • (ArgumentError)


28
29
30
31
# File 'lib/nera/nera_simulator.rb', line 28

def self.remove_simulator( sim_class)
  raise ArgumentError unless sim_class.is_a?(Class)
  @@inherited -= [ sim_class ]
end