Class: Interfacets::Test::Js::Receivers::Timer::Registration
- Inherits:
-
Object
- Object
- Interfacets::Test::Js::Receivers::Timer::Registration
- Defined in:
- lib/interfacets/test/js/receivers/timer.rb
Instance Attribute Summary collapse
-
#dispatch ⇒ Object
readonly
Returns the value of attribute dispatch.
-
#ms ⇒ Object
readonly
Returns the value of attribute ms.
-
#response_payload ⇒ Object
readonly
Returns the value of attribute response_payload.
Instance Method Summary collapse
-
#initialize(ms:, response_payload:, dispatch:) ⇒ Registration
constructor
A new instance of Registration.
- #notify ⇒ Object
Constructor Details
#initialize(ms:, response_payload:, dispatch:) ⇒ Registration
Returns a new instance of Registration.
13 14 15 16 17 18 |
# File 'lib/interfacets/test/js/receivers/timer.rb', line 13 def initialize(ms:, response_payload:, dispatch:) @ms = ms @response_payload = response_payload @dispatch = dispatch @notified = false end |
Instance Attribute Details
#dispatch ⇒ Object (readonly)
Returns the value of attribute dispatch.
11 12 13 |
# File 'lib/interfacets/test/js/receivers/timer.rb', line 11 def dispatch @dispatch end |
#ms ⇒ Object (readonly)
Returns the value of attribute ms.
11 12 13 |
# File 'lib/interfacets/test/js/receivers/timer.rb', line 11 def ms @ms end |
#response_payload ⇒ Object (readonly)
Returns the value of attribute response_payload.
11 12 13 |
# File 'lib/interfacets/test/js/receivers/timer.rb', line 11 def response_payload @response_payload end |
Instance Method Details
#notify ⇒ Object
20 21 22 23 24 |
# File 'lib/interfacets/test/js/receivers/timer.rb', line 20 def notify return if @notified @dispatch.call({ payload: response_payload }) @notified = true end |