lib/ury_rapid/services/responses/structure_builder.rb
# Defines a response group
#
# This effectively takes a module containing response structure codes
# as constants and, for the duration of the #group block, brings those
# codes into the global namespace.  It also serves as a nice way of
# grouping structures by the same structure used in the code table.
#
# @api      public
# @example  An example group block.
#   group Codes::Playlist do
#     # The group has brought DELETE_ITEM, MOVE_ITEM_IN_PLAYLIST,
#     # ITEM_COUNT, and ITEM_DATA into scope from Codes::Playlist
#     struct DELETE_ITEM,           index
#     struct MOVE_ITEM_IN_PLAYLIST, old_index, new_index
#     struct ITEM_COUNT,            count
#     struct ITEM_DATA,             index, uint32(:type), title
#   end
#
# @param code_module [Module]
#   The module, from the response code table, in which the command
#   codes for all of the responses in this group are defined.
#
# @return [null]
Defines a response group
This effectively takes a module containing response structure codes
as constants and, for the duration of the #group block, brings those
codes into the global namespace.  It also serves as a nice way of
grouping structures by the same structure used in the code table.
Defines a response group This effectively takes a module containing response structure codes as constants and for the duration of the #group block brings those codes into the global namespace . It also serves as a nice way of grouping structures by the same structure used in the code table .
def group(code_module)
          @code_module = code_module
          add_group_constants
          yield
        end
def group ( code_module ) @code_module = code_module add_group_constants yield end
Defines a response group
This effectively takes a module containing response structure codes
as constants and, for the duration of the #group block, brings those
codes into the global namespace.
Defines a response group This effectively takes a module containing response structure codes as constants and for the duration of the #group block brings those codes into the global namespace .
None
null
code_module
The module, from the response code table, in which the command codes for all of the responses in this group are defined.
The module from the response code table in which the command codes for all of the responses in this group are defined .
api
None
example
An example group block. group Codes::Playlist do # The group has brought DELETE_ITEM, MOVE_ITEM_IN_PLAYLIST, # ITEM_COUNT, and ITEM_DATA into scope from Codes::Playlist struct DELETE_ITEM, index struct MOVE_ITEM_IN_PLAYLIST, old_index, new_index struct ITEM_COUNT, count struct ITEM_DATA, index, uint32(:type), title end
An example group block . group Codes :: Playlist do # The group has brought DELETE_ITEM MOVE_ITEM_IN_PLAYLIST # ITEM_COUNT and ITEM_DATA into scope from Codes :: Playlist struct DELETE_ITEM index struct MOVE_ITEM_IN_PLAYLIST old_index new_index struct ITEM_COUNT count struct ITEM_DATA index uint32 ( : type ) title end