Class: Rectify::EventRecorder

Inherits:
Object
  • Object
show all
Defined in:
lib/rectify/command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEventRecorder

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

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

Returns:

  • (Boolean)


16
17
18
# File 'lib/rectify/command.rb', line 16

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