lib/ury_rapid/baps/requests/requester.rb
# Sends a request to the BAPS server
#
# @api public
# @example  Send a request.
#   requester.request(Rapid::Baps::Codes::Playlist::LOAD, chan) do |r|
#     r.uint32(index)
#   end
#
# @param code [Integer]  The BAPS protocol code for the request: this
#   will usually be a value from Rapid::Baps::Codes.
# @param subcode [Integer]  The sub-code for the request (usually a
#   channel ID or similar): this will default to 0 if not given.
#
# @yieldparam request [Request]  The request that is about to be sent,
#   so that it can have arguments added to it using the #uint32,
#   #string and similar methods.
#
# @return [void]
Sends a request to the BAPS server
Sends a request to the BAPS server
def request(code, subcode = 0, &block)
          request = Request.new(code, subcode)
          request.instance_exec(&block) if block
          request.to(@queue)
        end
def request ( code , subcode = 0 , & block ) request = Request . new ( code , subcode ) request . instance_exec ( & block ) if block request . to ( @queue ) end
Sends a request to the BAPS server
Sends a request to the BAPS server
None
void
code
The BAPS protocol code for the request: this will usually be a value from Rapid::Baps::Codes.
The BAPS protocol code for the request : this will usually be a value from Rapid :: Baps :: Codes .
subcode
The sub-code for the request (usually a channel ID or similar): this will default to 0 if not given.
The sub - code for the request ( usually a channel ID or similar ) : this will default to 0 if not given .
block
request
The request that is about to be sent, so that it can have arguments added to it using the #uint32, #string and similar methods.
The request that is about to be sent so that it can have arguments added to it using the #uint32 #string and similar methods .
api
None
example
Send a request. requester.request(Rapid::Baps::Codes::Playlist::LOAD, chan) do |r| r.uint32(index) end
Send a request . requester . request ( Rapid :: Baps :: Codes :: Playlist :: LOAD chan ) do |r| r . uint32 ( index ) end