Class: Controllers
Overview
ToDo: rename Controllers to MCUs
Direct Known Subclasses
Constant Summary collapse
- @@controllers_array =
[]
Class Method Summary collapse
-
.all ⇒ Object
list of USER`s microcontrolles.
- .find_mcu(name) ⇒ Object
-
.inherited(child_class) ⇒ Object
hook when define class.
- .is_real_controller? ⇒ Boolean
Class Method Details
.all ⇒ Object
list of USER`s microcontrolles
3 4 5 |
# File 'lib/rubimc/controllers.rb', line 3 def self.all # list of USER`s microcontrolles @@controllers_array end |
.find_mcu(name) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/rubimc/controllers.rb', line 16 def self.find_mcu(name) series_array = Controllers.descendants real_mcu_array = [] series_array.each {|series| real_mcu_array += series.descendants} return real_mcu_array.select {|mcu| mcu.is_real_controller? and mcu::MCU_NAME == name} end |
.inherited(child_class) ⇒ Object
hook when define class
8 9 10 |
# File 'lib/rubimc/controllers.rb', line 8 def self.inherited(child_class) # hook when define class @@controllers_array << child_class if child_class.is_real_controller? end |
.is_real_controller? ⇒ Boolean
12 13 14 |
# File 'lib/rubimc/controllers.rb', line 12 def self.is_real_controller? false end |