Class: RMachine::StateNotifierFactory
- Inherits:
-
Object
- Object
- RMachine::StateNotifierFactory
- Defined in:
- lib/r_machine/state_notifier_factory.rb
Instance Attribute Summary collapse
-
#message_args ⇒ Object
readonly
Returns the value of attribute message_args.
-
#message_name ⇒ Object
readonly
Returns the value of attribute message_name.
-
#object_called ⇒ Object
readonly
Returns the value of attribute object_called.
-
#state_template ⇒ Object
readonly
Returns the value of attribute state_template.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ StateNotifierFactory
constructor
A new instance of StateNotifierFactory.
- #is_notifying_state_machine? ⇒ Boolean
- #notifier ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ StateNotifierFactory
6 7 8 9 10 11 |
# File 'lib/r_machine/state_notifier_factory.rb', line 6 def initialize(params={}) @object_called = params[:object_called] @state_template = params[:state_template] @message_name = params[:message_name] @message_args = params[:message_args] end |
Instance Attribute Details
#message_args ⇒ Object (readonly)
Returns the value of attribute message_args.
3 4 5 |
# File 'lib/r_machine/state_notifier_factory.rb', line 3 def @message_args end |
#message_name ⇒ Object (readonly)
Returns the value of attribute message_name.
3 4 5 |
# File 'lib/r_machine/state_notifier_factory.rb', line 3 def @message_name end |
#object_called ⇒ Object (readonly)
Returns the value of attribute object_called.
3 4 5 |
# File 'lib/r_machine/state_notifier_factory.rb', line 3 def object_called @object_called end |
#state_template ⇒ Object (readonly)
Returns the value of attribute state_template.
3 4 5 |
# File 'lib/r_machine/state_notifier_factory.rb', line 3 def state_template @state_template end |
Instance Method Details
#is_notifying_state_machine? ⇒ Boolean
13 14 15 16 17 |
# File 'lib/r_machine/state_notifier_factory.rb', line 13 def is_calling_state_attribute? || is_changing_state_attribute? || is_calling_an_event? end |
#notifier ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/r_machine/state_notifier_factory.rb', line 19 def notifier if is_changing_state_attribute? build_change_state_value_notifier! elsif is_calling_state_attribute? build_retrieve_state_value_notifier! elsif is_calling_an_event? build_call_event_method_notifier! end end |