Module: SimpleState::Mixins
- Defined in:
- lib/simple_state/mixins.rb
Defined Under Namespace
Modules: Instance, Singleton
Class Method Summary
collapse
Class Method Details
.included(klass) ⇒ Object
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/simple_state/mixins.rb', line 3
def self.included(klass)
klass.class_eval <<-RUBY, __FILE__, __LINE__ + 1
attr_reader :state unless method_defined?(:state)
@@states = {}
@@initial_state = nil
unless method_defined?(:state=)
attr_writer :state
private :state=
end
extend Singleton
include Instance
RUBY
end
|