Class: Decidim::EventRecorder

Inherits:
Object
  • Object
show all
Defined in:
lib/decidim/event_recorder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEventRecorder

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

#eventsObject (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

Returns:

  • (Boolean)


21
22
23
# File 'lib/decidim/event_recorder.rb', line 21

def respond_to_missing?(_method_name, _include_private = false)
  true
end