Module: Lotu::SystemUser
- Defined in:
- lib/lotu/behaviors/system_user.rb
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#systems ⇒ Object
Returns the value of attribute systems.
Class Method Summary collapse
Instance Method Summary collapse
-
#draw ⇒ Object
Need to call this inside draw.
-
#init_behavior(user_opts) ⇒ Object
PONDER: Cambiar por initialize? y controlar el punto de llamado con super?.
-
#update ⇒ Object
Need to call this inside update.
Instance Attribute Details
#systems ⇒ Object
Returns the value of attribute systems.
4 5 6 |
# File 'lib/lotu/behaviors/system_user.rb', line 4 def systems @systems end |
Class Method Details
.included(base) ⇒ Object
6 7 8 |
# File 'lib/lotu/behaviors/system_user.rb', line 6 def self.included base base.extend ClassMethods end |
Instance Method Details
#draw ⇒ Object
Need to call this inside draw
35 36 37 38 39 40 41 |
# File 'lib/lotu/behaviors/system_user.rb', line 35 def draw super if defined? super # Systems may report interesting stuff @systems.each_value do |system| system.draw end end |
#init_behavior(user_opts) ⇒ Object
PONDER: Cambiar por initialize? y controlar el punto de llamado con super?
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/lotu/behaviors/system_user.rb', line 12 def init_behavior user_opts super if defined? super @systems ||= Hash.new = self.class.[SystemUser] && .each do |klass, | # add the behavior options to the user_opts hash # in case we need access to some level class config param user_opts.merge!() @systems[klass] = klass.new( self, user_opts ) end end |
#update ⇒ Object
Need to call this inside update
27 28 29 30 31 32 |
# File 'lib/lotu/behaviors/system_user.rb', line 27 def update super if defined? super @systems.each_value do |system| system.update end end |