Module: Stateful::Poro
- Defined in:
- lib/Stateful/Poro.rb,
lib/Stateful/Poro/ClassMethods.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
- .extended(klass) ⇒ Object (also: included)
- .set_variable_name(klass) ⇒ Object
Class Method Details
.extended(klass) ⇒ Object Also known as: included
19 20 21 22 23 24 |
# File 'lib/Stateful/Poro.rb', line 19 def extended(klass) klass.extend(Stateful::ClassMethods) klass.send(:include, Stateful::InstanceMethods) set_variable_name(klass) klass.extend(Stateful::Poro::ClassMethods) end |
.set_variable_name(klass) ⇒ Object
13 14 15 16 17 |
# File 'lib/Stateful/Poro.rb', line 13 def set_variable_name(klass) unless klass.instance_variable_get(:@stateful_variable_name) klass.instance_variable_set(:@stateful_variable_name, 'current_state') end end |