Class: Ribbon::Intercom::Packet::MethodQueue

Inherits:
Object
  • Object
show all
Defined in:
lib/ribbon/intercom/packet/method_queue.rb

Instance Method Summary collapse

Instance Method Details

#each(&block) ⇒ Object

Iterate through the methods and arguments.



13
14
15
# File 'lib/ribbon/intercom/packet/method_queue.rb', line 13

def each(&block)
  _queue.each(&block)
end

#empty?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/ribbon/intercom/packet/method_queue.rb', line 17

def empty?
  _queue.empty?
end

#enqueue(name, *args) ⇒ Object

Enqueue a method with it’s arguments. Supports method chaining.



7
8
9
# File 'lib/ribbon/intercom/packet/method_queue.rb', line 7

def enqueue(name, *args)
  self.tap { _queue << [name, *Utils.sanitize(args)] }
end