Class: NERA::Simulator
- Inherits:
-
Object
- Object
- NERA::Simulator
- Defined in:
- lib/nera/nera_simulator.rb
Constant Summary collapse
- Parameters =
[]
- @@inherited =
class methods, variables
[]
Instance Attribute Summary collapse
-
#param ⇒ Object
Returns the value of attribute param.
Class Method Summary collapse
- .add_simulator(sim_class) ⇒ Object
- .inherited(subclass) ⇒ Object
- .inherited_simulators ⇒ Object
- .remove_simulator(sim_class) ⇒ Object
Instance Method Summary collapse
-
#initialize ⇒ Simulator
constructor
A new instance of Simulator.
Constructor Details
#initialize ⇒ Simulator
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
#param ⇒ Object
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
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_simulators ⇒ Object
24 25 26 |
# File 'lib/nera/nera_simulator.rb', line 24 def self.inherited_simulators return @@inherited end |
.remove_simulator(sim_class) ⇒ Object
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 |