lib/ury_rapid/services/code_table.rb
def find_code_in(submodule, code)
        submodule.constants
          .find { |name| submodule.const_get(name) == code }
          .try  { |name| "#{submodule}::#{name}" }
      end
# Attempts to find the name of a command code in a submodule
#
# @api private
#
# @param submodule [Module]
#   The submodule to search for the code's name.
# @param code [Integer]
#   One of the codes from Rapid::Baps::Codes.
#
# @return [String]
#   The (semi) human-readable name for the command code.
#
Attempts to find the name of a command code in a submodule
Attempts to find the name of a command code in a submodule
def find_code_in(submodule, code)
        submodule.constants
          .find { |name| submodule.const_get(name) == code }
          .try  { |name| "#{submodule}::#{name}" }
      end
def find_code_in ( submodule , code ) submodule . constants . find { | name | submodule . const_get ( name ) == code } . try { | name | "#{submodule}::#{name}" } end
Attempts to find the name of a command code in a submodule
Attempts to find the name of a command code in a submodule
The (semi) human-readable name for the command code.
The ( semi ) human - readable name for the command code .
String
submodule
The submodule to search for the code's name.
The submodule to search for the code ' s name .
code
One of the codes from Rapid::Baps::Codes.
One of the codes from Rapid :: Baps :: Codes .
api
None