Class: Rectify::EventRecorder
- Inherits:
-
Object
- Object
- Rectify::EventRecorder
- Defined in:
- lib/rectify/command.rb
Instance Attribute Summary collapse
-
#events ⇒ Object
readonly
Returns the value of attribute events.
Instance Method Summary collapse
-
#initialize ⇒ EventRecorder
constructor
A new instance of EventRecorder.
-
#method_missing(method_name, *args, &_block) ⇒ Object
rubocop:disable Style/MethodMissing.
-
#respond_to_missing?(_method_name, _include_private = false) ⇒ Boolean
rubocop:enable Style/MethodMissing.
Constructor Details
#initialize ⇒ EventRecorder
Returns a new instance of EventRecorder.
5 6 7 |
# File 'lib/rectify/command.rb', line 5 def initialize @events = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &_block) ⇒ Object
rubocop:disable Style/MethodMissing
10 11 12 13 |
# File 'lib/rectify/command.rb', line 10 def method_missing(method_name, *args, &_block) args = args.first if args.size == 1 @events[method_name] = args end |
Instance Attribute Details
#events ⇒ Object (readonly)
Returns the value of attribute events.
3 4 5 |
# File 'lib/rectify/command.rb', line 3 def events @events end |
Instance Method Details
#respond_to_missing?(_method_name, _include_private = false) ⇒ Boolean
rubocop:enable Style/MethodMissing
16 17 18 |
# File 'lib/rectify/command.rb', line 16 def respond_to_missing?(_method_name, _include_private = false) true end |