Class: Wizrb::Shared::Events::Base
- Inherits:
-
Object
- Object
- Wizrb::Shared::Events::Base
- Defined in:
- lib/wizrb/shared/events/base.rb
Direct Known Subclasses
Lighting::Events::SetBrightnessEvent, Lighting::Events::SetColdWhiteEvent, Lighting::Events::SetColorTempEvent, Lighting::Events::SetRgbEvent, Lighting::Events::SetSceneEvent, Lighting::Events::SetSpeedEvent, Lighting::Events::SetWarmWhiteEvent, PowerEvent, RebootEvent, RefreshEvent, ResetEvent
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(method:, params: {}) ⇒ Base
constructor
A new instance of Base.
- #to_json(*_args) ⇒ Object
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
#params ⇒ Object (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 |