Class: Debouncer::Group
- Inherits:
-
Object
- Object
- Debouncer::Group
- Includes:
- Inspection
- Defined in:
- lib/debouncer/group.rb
Instance Attribute Summary collapse
-
#debouncer ⇒ Object
readonly
Returns the value of attribute debouncer.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #call(*args, &block) ⇒ Object
- #flush ⇒ Object
- #flush! ⇒ Object
-
#initialize(debouncer, id) ⇒ Group
constructor
A new instance of Group.
- #inspect_params ⇒ Object
- #join ⇒ Object
- #kill ⇒ Object
- #to_proc ⇒ Object
Methods included from Inspection
Constructor Details
#initialize(debouncer, id) ⇒ Group
Returns a new instance of Group.
7 8 9 10 |
# File 'lib/debouncer/group.rb', line 7 def initialize(debouncer, id) @debouncer = debouncer @id = id end |
Instance Attribute Details
#debouncer ⇒ Object (readonly)
Returns the value of attribute debouncer.
5 6 7 |
# File 'lib/debouncer/group.rb', line 5 def debouncer @debouncer end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/debouncer/group.rb', line 5 def id @id end |
Instance Method Details
#call(*args, &block) ⇒ Object
12 13 14 15 |
# File 'lib/debouncer/group.rb', line 12 def call(*args, &block) @debouncer.call_with_id @id, *args, &block self end |
#flush ⇒ Object
21 22 23 24 |
# File 'lib/debouncer/group.rb', line 21 def flush @debouncer.flush @id self end |
#flush! ⇒ Object
26 27 28 29 |
# File 'lib/debouncer/group.rb', line 26 def flush! @debouncer.flush! @id self end |
#inspect_params ⇒ Object
41 42 43 |
# File 'lib/debouncer/group.rb', line 41 def inspect_params {delay: @debouncer.delay, scheduled: @debouncer.runs_at(@id) || 'idle'} end |
#join ⇒ Object
31 32 33 34 |
# File 'lib/debouncer/group.rb', line 31 def join @debouncer.join @id self end |
#kill ⇒ Object
36 37 38 39 |
# File 'lib/debouncer/group.rb', line 36 def kill @debouncer.kill @id self end |
#to_proc ⇒ Object
17 18 19 |
# File 'lib/debouncer/group.rb', line 17 def to_proc method(:call).to_proc end |