Class: Wizrb::Shared::Events::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/wizrb/shared/events/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method:, params: {}) ⇒ Base

Returns a new instance of Base.



11
12
13
14
# File 'lib/wizrb/shared/events/base.rb', line 11

def initialize(method:, params: {})
  @method = method
  @params = params
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



9
10
11
# File 'lib/wizrb/shared/events/base.rb', line 9

def params
  @params
end

Instance Method Details

#to_json(*_args) ⇒ Object



16
17
18
# File 'lib/wizrb/shared/events/base.rb', line 16

def to_json(*_args)
  @to_json ||= {method: @method, params: @params}.to_json
end