Class: Decidim::EventRecorder
- Inherits:
-
Object
- Object
- Decidim::EventRecorder
- Defined in:
- lib/decidim/event_recorder.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
- #respond_to_missing?(_method_name, _include_private = false) ⇒ Boolean
Constructor Details
#initialize ⇒ EventRecorder
Returns a new instance of EventRecorder.
12 13 14 |
# File 'lib/decidim/event_recorder.rb', line 12 def initialize @events = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &_block) ⇒ Object
16 17 18 19 |
# File 'lib/decidim/event_recorder.rb', line 16 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.
10 11 12 |
# File 'lib/decidim/event_recorder.rb', line 10 def events @events end |
Instance Method Details
#respond_to_missing?(_method_name, _include_private = false) ⇒ Boolean
21 22 23 |
# File 'lib/decidim/event_recorder.rb', line 21 def respond_to_missing?(_method_name, _include_private = false) true end |